This is a matter of significant scholarly discussion. نبی کریم (صلی اللہ علیہ وسلم) stated clearly that no woman should travel without a mahram, and this is the basis for the Hanafi and Hanbali position that a mahram is an absolute condition for a woman's obligation of حج. If a woman has no mahram willing and able to travel with her, حج is not واجب upon her according to these schools.
Sheikh Ibn Baz and Sheikh Ibn Uthaymeen both held the position that a mahram is required for a woman traveling for حج, and that without a mahram, the obligation of حج does not apply to her. If she dies without having performed حج due to the absence of a mahram, she is not sinful. They considered the mahram to be part of the conditions of istitaa'ah (ability) for women.
However, the Shafi'i and Maliki schools hold a different position. They permit a woman to travel for واجب حج with a group of trustworthy women, even without a mahram, provided that safety is ensured. Imam al-Nawawi reported the Shafi'i position that a mahram is not a condition for the obligation of حج if the woman can travel safely with trustworthy companions. The Saudi Ministry of حج now permits women aged 45 and above to perform حج without a mahram if traveling with an organized group.