The corrosion mechanism of L245NS steel and L360QS steel of gas injection/withdrawal pipeline of underground gas storage in different acidic gas environments was studied by means of SEM, EDS, XRD, XPS, and GC-MS. The results show that Fe2O3, Fe3O4, and CaCO3 with poor protection were formed on the surface of L245NS steel, which provided a channel for the corrosive medium to contact the surface of the metal matrix and accelerated the corrosion rate of the pipeline. Meanwhile, CI- had a small radius and strong penetrability, which was easy to pass through the product film to reach the surface of the metal matrix to participate in the reaction, resulting in corrosion defect pits. The inner wall of L360QS steel was attached with gum, forming a dense protective film on the inner surface of the pipeline, and it was difficult for corrosive substances to enter the metal matrix, which played a role in inhibiting the corrosion of the pipeline.