In recent years, gas leakage from buried pipelines has been an inevitable issue worldwide. The leaked gas can diffuse through the soil into adjacent underground confined spaces, such as sewage pipelines, thereby posing significant risks to human lives and property in the event of a fire. To investigate the diffusion characteristics of leaked natural gas in underground semiconfined spaces, this paper establishes a mathematical model for natural gas diffusion in sewage pipelines. The study examines the impact of the gas inlet velocity, sewage flow velocity, water level height, and vent hole size on the characteristics of gas diffusion within sewage pipelines. The concentration of natural gas in the manhole increases as the natural gas inlet velocity, sewage flow velocity (up to 0.6 m/s), and water level height rise, with the magnitude of the increase gradually diminishing. Additionally, it was observed that the size of the vent hole significantly affects the concentration at upstream test points. In contrast, its effect on the concentration variations of downstream test points gradually weakens. This paper also puts forward a three-level early warning mechanism and analyzes and discusses the influence of the above factors on the early warning time of natural gas in the manhole.