The Messenger of Allah ﷺ said, "Permit women to go to the mosques at night."His son said, "By Allah, we will not permit them. They will use it as a means of mischief."He said, "May Allah do such and such to you! I tell you that the Messenger of Allah ﷺ said it, and you say, 'We will not permit them'?"
حدثنا نصر بن علي حدثنا عيسى بن يونس عن الأعمش عن مجاهد قال كنا عند
قال رسول الله ﷺ ائذنوا للنساء بالليل إلى المساجد فقال ابنه والله لا نأذن لهن يتخذنه دغلا فقال فعل الله بك وفعل أقول قال رسول الله ﷺ وتقول لا نأذن لهن
Agreed upon (by Bukhari and Muslim). Muslim narrated it in the Book of Prayer, Chapter on Women Going Out to the Mosques When It Does Not Lead to [Temptation, etc.], no. 442, from the hadith of Isa bin Yunus, and Bukhari, no. 899, from the hadith of Mujahid, with the wording "there would be temptation because of it... etc." There is also a report on this subject from Abu Hurairah [Abu Dawud, no. 565], Zaynab, the wife of Abdullah bin Masud [Muslim, no. 443], and Zayd bin Khalid [Ahmad, 5/192, 193, and Ibn Hibban, no. 326].