The frequency of extreme rainfall events is on the rise due to rapid urbanization. These occurrences significantly impact the soil environment beneath urban areas, subsequently affecting the crucial lifeline water supply piping system beneath the city. The water supply pipeline system, designed to endure various loads, faces accelerated deterioration from both soil erosion during extreme rainfall and internal water flow. This dual erosion hastens pipeline destruction, leading to substantial economic losses. Therefore, studying the corrosion process of water supply pipelines in complex soil environments caused by extreme rainfall is crucial for urban water supply safety. This study focuses on Shanghai, a city characterized by advanced urbanization and frequent extreme rainstorms. Using COMSOL software, we couple three aspects: soil corrosion, sulfate erosion of water supply pipe walls, and external forces under extreme rainfall conditions. A numerical simulation model of buried pipelines is constructed based on the coupling of these physical fields. The HandySCAN700 scanner is employed to detect water supply pipeline data in Shanghai. Applying basic pipeline parameters to the model simulates corrosion under varying rainfall intensities. Corrosion severity is characterized by parameters such as stress, plastic strain, corrosion potential, and corrosion current density at defects. The objective is to establish the relationship between the pipeline's service life and corrosion degree under diverse rainfall conditions. Validation of simulation results is performed using detection data, summarizing the corrosion resistance pattern between the pipeline's service life and extreme rainfall conditions. This facilitates predicting water supply pipeline corrosion in different rainfall areas and provides technical support for the corrosion-resistant design of water supply pipelines and lifeline projects in urban areas.