The World Federation One Stop Fiqh

Ruling 2425

If a person marries a woman while he is in the state of iḥrām (iḥrām is one of the requirements of hajj),9 the marriage contract is invalid even if the woman is not in the state of iḥrām herself. In the event that he knew that marrying a woman [in the state of iḥrām] was unlawful for him, he can never marry that woman.

9 Iḥrām here refers to the state of ritual consecration of pilgrims during hajj and ʿumrah.