We present results from an X-ray photoemission spectroscopy (XPS) study of CoFeB/MgO bilayers where we observe process-dependent formation of B, Fe, and Co oxides at the CoFeB/MgO interface due to oxidation of CoFeB during MgO deposition. Vacuum annealing reduces the Co and Fe oxides but further incorporates B into the MgO forming a composite MgB x O y layer. Inserting an Mg layer between CoFeB and MgO introduces an oxygen sink, providing increased control over B content in the barrier.