Bulugh al-Maram 111
وَعَنْ أَنَسِ بْنِ مَالِكٍ- رضي الله عنه - قَالَ: قَالَ رَسُولُ اللَّهِ - صلى الله عليه وسلم - فِي الْمَرْأَةِ تَرَى فِي مَنَامِهَا مَا يَرَى الرَّجُلُ- قَالَ: «تَغْتَسِلُ». مُتَّفَقٌ عَلَيْهِ. زَادَ مُسْلِمٌ: فَقَالَتْ أُمُّ سُلَيْمٍ: وَهَلْ يَكُونُ هَذَا? قَالَ: «نَعَمْ فَمِنْ أَيْنَ يَكُونُ الشَّبَهُ?».
From Anas ibn Malik, may Allah be pleased with him, who said: The Messenger of Allah ﷺ said about a woman who sees in her sleep what a man sees: "She should bathe." Agreed upon. Muslim added: Umm Sulaym said: "Does this happen?" He said: "Yes; otherwise where does the resemblance come from?"