Abstract It was recently discovered that in some regions of the Galaxy, the cosmic-ray (CR) abundance is several orders of magnitude higher than previously thought. Additionally, there is evidence that in molecular cloud envelopes, the CR ionization may be dominated by electrons. We show that for regions with high, electron-dominated ionization, the penetration of CR electrons into molecular clouds is modulated by the electric field that develops as a result of the charge they deposit. We evaluate the significance of this novel mechanism of self-modulation and show that the CR penetration can be reduced by a factor of a few to a few hundred in high-ionization environments, such as those found near the Galactic center.