Abu Tufayl reported,

I was with Ali bin Abu Talib when a man came to him and asked, "What did the Prophet ﷺ confide to you in private?"He became angry and replied, "The Prophet ﷺ never confided to me anything that he concealed from the people, except that he told me four statements."The man asked, "What are they, Commander of the Believers?"He said, "He said, 'Allah has cursed whoever curses his father. Allah has cursed whoever sacrifices to other than Allah. Allah has cursed whoever shelters an innovator. And Allah has cursed whoever alters the boundary markers of the land.'"

Muslim 5124

Sahih

حدثنا زهير بن حرب وسريج بن يونس كلاهما عن مروان قال زهير حدثنا مروان بن معاوية الفزاري حدثنا منصور بن حيان

حدثنا أبو الطفيل عامر بن واثلة قال

كنت عند علي بن أبي طالب فأتاه رجل فقال ما كان النبي ﷺ يسر إليك قال فغضب وقال ما كان النبي ﷺ يسر إلي شيئا يكتمه الناس غير أنه قد حدثني بكلمات أربع قال فقال ما هن يا أمير المؤمنين قال قال لعن الله من لعن والده ولعن الله من ذبح لغير الله ولعن الله من آوى محدثا ولعن الله من غير منار الأرض

مسلم 5124صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Sacrificial animals
Chapter
Prohibition of slaughtering for other than Allah and cursing the one who does so
Numbering
Darussalam 5124
Muslim 5124