The efficiency of cavity sideband cooling of trapped molecules is theoretically investigated for the case in which the infrared transition between two rovibrational states is used as a cycling transition. The molecules are assumed to be trapped either by a radiofrequency or optical trapping potential, depending on whether they are charged or neutral, and confined inside a high-finesse optical resonator that enhances radiative emission into the cavity mode. Using realistic experimental parameters and COS as a representative molecular example, we show that in this setup, cooling to the trap ground state is feasible.