Both are caused by a defect in hydroxylation of cortisol precursors, most commonly 21-hydroxylase deficiency, or the much milder condition of 11beta-hydroxylase deficiency.; cortisol precursors accumulate and are shunted into the production of androgens.