In this paper, we analyze a general diffuse interface model for incompressible two-phase flows with unmatched densities in a smooth bounded domain $$\Omega \subset {\mathbb {R}}^d$$ ( $$d=2,3$$ ). This model describes the evolution of free interfaces in contact with the solid boundary, namely the moving contact lines. The corresponding evolution system consists of a nonhomogeneous Navier–Stokes equation for the (volume) averaged fluid velocity $${\mathbf {v}}$$ that is nonlinearly coupled with a convective Cahn–Hilliard equation for the order parameter $$\varphi $$ . Due to the nontrivial boundary dynamics, the fluid velocity satisfies a generalized Navier boundary condition that accounts for the velocity slippage and uncompensated Young stresses at the solid boundary, while the order parameter fulfils a dynamic boundary condition with surface convection. We prove the existence of a global weak solution for arbitrary initial data in both two and three dimensions. The proof relies on a combination of suitable approximations and regularizations of the original system together with a novel time-implicit discretization scheme based on the energy dissipation law.