The Prophet ﷺ said, "Madinah is sacred. Whoever introduces an innovation into it, or harbors one who does so, will incur the curse of Allah, the angels, and all of mankind. On the Day of Resurrection, no obligatory deed nor voluntary deed will be accepted from him."
قال النبي ﷺ: المدينة حرم، فمن أحدث فيها حدثا أو آوى محدثا، فعليه لعنة الله والملائكة والناس أجمعين، ولا يقبل منه يوم القيامة عدل ولا صرف.
Muslim narrated it in the book of Hajj (1371) from Abu Bakr bin Abu Shayba, who said, Husayn bin Ali Jafi narrated to us, from Zaida, from Sulayman, from Abu Salih, from Abu Hurairah, and he related it.In the narration of Sufyan, from Amash, it is similar, but he did not say "on the Day of Resurrection." He added, "The protection of the Muslims is one, upheld even by the humblest of them. Whoever violates the protection granted by a Muslim, upon him is the curse of Allah, the angels, and all people. No ransom or exchange will be accepted from him on the Day of Resurrection."His saying "akhfara" means he violated the safety guarantee granted by a Muslim, thereby exposing to harm a disbeliever whom a Muslim had granted safety.