Affected by confined aquifer, basal inrush accidents caused by excavation are common in foundation pits, and accurate estimation of the safety thickness of the base is a big concern of engineers. In this paper, a three-dimensional failure mechanism of base inrush was constructed for a rectangular foundation pit. In this mechanism, the strength of the soil mass was assumed to be nonhomogeneous along the depth, and the soil-mass failure satisfied the linear and nonlinear Mohr–Coulomb strength criteria. Then, based on the limit equilibrium theory, the prediction method for the safety thickness of the base against confined water inrush was deduced, and a comparison with existing research works was conducted. Furthermore, the influence laws of soil strength parameters, pit design parameters, and confined water pressure on the critical safety thickness were analyzed. The results show that the critical safety thickness of the base is positively correlated with nonlinear coefficient and confined water pressure but negatively correlated with cohesion, internal friction angle, nonhomogeneity coefficient, and unit weight. The soil strength is a key factor affecting the base safety thickness, which should be paid enough attention to in engineering design and construction. The research findings in this paper can provide a theoretical reference for the prevention and control of basal inrush accidents in confined water strata.