The correct position is the latter, for the ḥadith is worded in universal terms that apply to every woman, and the situation is never free of risk—“every stray object finds someone ready to snatch it up.”
The scholars also disagreed whether it would suffice for her to be in the company of trustworthy fellow-travelers or to journey with a reliable Muslim woman. The outward sense of the ḥadith is that a maḥram is indispensable, since the maḥram’s protective jealousy and watchful care are otherwise absent.
Shaykh al-Islām Ibn Taymiyyah said: If the woman is one of the elderly who no longer menstruate, have despaired of marriage, and have no maḥram, then according to one of the two scholarly opinions she may perform ḥajj with whomever she trusts. This is one narration from Aḥmad and is the position of Mālik and al-Shāfiʿī.
The Muslims are unanimously agreed that a woman may not travel without a maḥram unless she can do so in complete safety. Each school then specified what, in its view, would safeguard her—whether a group of trustworthy women or reliable men—and prohibited her from travelling without that protection. All the more deserving, therefore, is the condition laid down by Allah and His Messenger ﷺ, whose wisdom is plain to see. Those who set aside the ḥadiths’ apparent meaning and allowed her to travel whenever she is safe focused on the intended rationale and argued that she is, in principle, commanded to perform ḥajj by the verse, “And [due] to Allah from the people is a pilgrimage to the House—for whoever is able to find thereto a way” (Q 3:97).
Those who adhered to the literal wording that forbids her to travel replied that the ḥadith qualifies that verse, just as other reports do—for example, the case of the soldier whose wife had set out for ḥajj and whom the Prophet ﷺ ordered to leave the battlefield and accompany his wife, along with similar narrations.
They also differed about how to define “travel,” because the ḥadiths vary: some mention “a day,” others “two days,” “three nights,” “one night,” or “a barīd” (about twelve miles). The safest course is to adopt the shortest of these distances, for that does not contradict the longer ones, while the longer references may relate to specific circumstances of the questioner. Allah knows best.