In this work, we will present the first complete calculation of the one-loop longitudinal photon-to-quark-antiquark light cone wave function, with massive quarks. The quark masses are renormalized in the pole mass scheme. The result is used to calculate the next-to-leading order correction to the high energy Deep Inelastic Scattering longitudinal structure function on a dense target in the dipole factorization framework. For massless quarks the next-to-leading order correction was already known to be sizeable, and our result makes it possible to evaluate it also for massive quarks.