The paper concerns assessment of the durability of a thin-walled elastic pipe subjected to uniform corrosion under internal and/or external pressures of different media with generally different temperatures. Stress-assisted corrosion of thin-walled pipes under pressure was earlier studied by other authors. Being based on the Laplace law, their solutions do not reflect the effect of internal and external pressure values themselves but only the pressure difference. However, as it is known, hydrostatic pressure may affect the corrosion rate. Unlike the solutions based on the Laplace law, we present a solution taking into account the effects of both internal and external pressures (not only their difference), a difference in the elastic stresses through the pipe wall thickness, and thermal stresses. In accordance with available experimental data, the rate of corrosion is supposed to be linearly dependent on the maximal principal stress at the corresponding surface and exponentially dependent on the temperature. Being presented in a closed form, the obtained solution can serve as a benchmark for numerical analysis and for design purposes.