صحيح مسلم
From Sahih Muslim (Hadith 5673):
Jabir reported Allah's Messenger (ﷺ) as saying:Behold, no person should spend the night with a married woman, but only in case he is married to her or he is her Mahram
Reference: Muslim 5673