Question:
If a muhrim (a person in the state of ihram) becomes junubi (in a state of major ritual impurity), must he perform ghusl?
Answer:
If a muhrim becomes junubi, then ghusl for janabah is obligatory upon him by consensus.
❀ Hafiz al-Nawawi (may Allah have mercy on him)
Reference: (676 AH)
says:
اتفق العلماء على جواز غسل المحرم رأسه وجسده من الجنابة بل هو واجب عليه
The people of knowledge are agreed that it is permissible, indeed obligatory, for a muhrim in the state of janabah to wash his head and body.
Reference: (Sharh Muslim: 8/126)