Abdullah bin Abbas reported,

A man came to Madinah, and the Prophet ﷺ asked him, "Where are you staying?"He replied, "With so-and-so, a woman."The Prophet ﷺ said, "Did she shut her door upon you? No woman should perform Hajj except in the company of a male relative within the prohibited degrees of marriage."

Azami 4744

Sahih

عن ابن عباس قال

جاء رجل إلى المدينة، فقال النبي ﷺ أين نزلت؟ قال على فلانة قال: أغلقت عليك بابها؟ لا تحجن امرأة إلا ومعها ذو محرم.

الأعظمي 4744صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Hajj
Chapter
Obligation of Hajj, its virtue, and its conditions
Section
Presence of a husband or mahram with a woman when traveling for Hajj and Umrah
Numbering
Jami al-Kamil 4744 (2nd edition)
Azami 4744