Currently, with the continuous development of electric vehicles, DC microgrids have attracted widespread attention due to their flexible access methods and high energy transmission efficiency. However, since the distributed secondary control of DC microgrids relies on information exchange through communication networks, false data injection (FDI) attacks on these networks may cause control algorithms to fail, leading to voltage deviations, output current imbalance, and in severe cases, system instability. This study focuses on DC microgrids based on parallel DC–DC buck converters and proposes a distributed secondary control strategy based on a sliding mode observer to address FDI attacks. By treating the system's FDI attack signals as an extended state, an extended sliding mode observer is designed to track the attack signals. Based on the observed attacks, a control algorithm is proposed that compensates the control inputs through the observer, ensuring proportional sharing of bus voltage and converter output currents. The stability of the system under the proposed control method is proven using the Lyapunov method and verified through MATLAB simulations. Simulation results show that the sliding mode observer (SMO) can quickly and accurately estimate FDI attack signals under various types of attacks, including periodic and step disturbances, and under load changes, while the system maintains stable bus voltage and current sharing. This research provides a potential technical approach to ensure the safe and stable operation of DC systems in future smart charging stations and grids with high renewable energy penetration.