The Messenger of Allah ﷺ said, "Madinah is sacred. Whoever commits a wrong within it or shelters one who has done so, upon him is the curse of Allah, the angels, and all people. On the Day of Resurrection, Allah will accept from him neither obligatory worship nor voluntary."
حدثنا يحيى بن آدم حدثنا قطبة عن الأعمش عن أبي صالح
قال رسول الله ﷺ المدينة حرم فمن أحدث فيها حدثا أو آوى محدثا فعليه لعنة الله والملائكة والناس أجمعين لا يقبل الله منه يوم القيامة عدلا ولا صرفا
Its isnad is sahih. It occurred previously at 9770, and Qutbah is Ibn Abdul-Aziz bin Siyah, who is trustworthy.