  We consider heavy sterile neutrinos $\nu_s$, with mass in the range 10 MeV
$\lesssim m_s \lesssim m_{\pi} \sim 135$ MeV, thermally produced in the early
universe and freezing out after the QCD phase transition. The existence of
these neutrinos may alter the value of the effective number of neutrino species
$N_{\rm eff}$, measured by the cosmic microwave background (CMB), and the
${}^4$He production during the BBN. We provide a detailed account of the
solution of the relevant Boltzmann equations and we identify the parameter
space constrained by current Planck satellite data and forecast the parameter
space probed by future Stage-4 ground-based CMB (CMB-S4) observations.
