Hadithcore
Mishkat al-Masabih, 3101

Jabir reported God's Messenger as saying, “A man must not spend the night in the house of a woman who has been married unless he is her husband or a close relative.” Muslim transmitted it.

وَعَنْ جَابِرٍ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «إِلَّا لَا يبتن رَجُلٌ عِنْدَ امْرَأَةٍ ثَيِّبٍ إِلَّا أَنْ يَكُونَ ناكحا أَو ذَا محرم» . رَوَاهُ مُسلم

References1 variant
In-Book Reference
Book 13, Hadith 22