The Messenger of Allah ﷺ cursed women who frequently visit graves, those who build mosques over them, and those who place lamps upon them.
أخبرنا قتيبة قال حدثنا عبد الوارث بن سعيد عن محمد بن جحادة عن أبي صالح
لعن رسول الله ﷺ زائرات القبور والمتخذين عليها المساجد والسرج
Its chain of transmission is daif.Narrated by Tirmidhi, in the Book of Prayer, chapter on the dislike of making a masjid over a grave, hadith no. 320, from Qutayba, with this chain. He said, "Hasan." It also appears in Kubra, hadith no. 2170. Ibn Majah narrated it, hadith no. 1575, from the narration of Abdul-Warith, and Abu Dawud, hadith no. 3236, from the narration of Muhammad bin Jahada, with this chain.Abu Salih Bazam, the freedman of Umm Hani, is daif and a mudallis (as stated in Taqrib), and he narrated this after his memory had become confused.