We investigate, through first-principles calculations, the energetics of substitutional carbon and oxygen impurities as well as complexes involving these impurities and vacancies in cubic boron nitride (c-BN). The formation energies and the electronic and structural properties of these defects in their various charge states are investigated. We find that, under a boron-rich condition, both the carbon and the oxygen impurities at the nitrogen site (C N and O N) have formation energies comparable to or lower than those calculated for the vacancies, which are the lowest-energy intrinsic defects. Regarding defect complexes, we find that the donor character observed for the nitrogen vacancy (V N) can be compensated by the C N impurity in the formation of a V N-C N complex which has low formation energies. We also find that the V B-O N complex has low formation energies under n-type conditions. In contrast to the above mentioned complexes, we find that the V B-C B complex has high formation energies under a boron-rich condition, and shall only occur under a nitrogen-rich condition.