Although the MiniBooNE experiment has severely restricted the possible existence of light sterile neutrinos, a few anomalies persist in oscillation data, and the possibility of extra light species contributing as a subdominant hot (or warm) component is still interesting. In many models, this species would be in thermal equilibrium in the early universe and share the same temperature as active neutrinos, but this is not necessarily the case. In this work, we fit up-to-date cosmological data with an extended Lambda CDM model, including light relics with a mass typically in the range 0.1-10 eV. We provide, first, some nearly model-independent constraints on their current density and velocity dispersion, and second, some constraints on their mass, assuming that they consist either in early decoupled thermal relics, or in nonresonantly produced sterile neutrinos. Our results can be used for constraining most particle-physics-motivated models with three active neutrinos and one extra light species. For instance, we find that at the 3 sigma confidence level, a sterile neutrino with mass m(s)=2 eV can be accommodated with the data provided that it is thermally distributed with T-s/T-nu(id)less than or similar to 0.8 or nonresonantly produced with Delta N-eff less than or similar to 0.5. The bounds become dramatically tighter when the mass increases. For m(s)less than or similar to 0.9 eV and at the same confidence level, the data is still compatible with a standard thermalized neutrino.