كتاب الأضاحى
35  
The Book of Sacrifices
(8)
Chapter: The prohibition of slaughtering a sacrifice for anything other than Allah, and the one who does that is cursed
(8)
باب تَحْرِيمِ الذَّبْحِ لِغَيْرِ اللَّهِ تَعَالَى وَلَعْنِ فَاعِلِهِ ‏‏
Sahih Muslim 1978 b

Abu Tufail reported:

We said to 'Ali b. Abi Talib: Inform us about something which Allah's Messenger (ﷺ) told you in secret, whereupon he said: He told me nothing in secret which he bid from people, but I heard him say: Allah cursed him who sacrificed for anyone besides Allah; and cursed him who accommodated an innovator; and Allah cursed him who cursed his parents and Allah cursed him who changed the boundary lines (of the land possessed by him).
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا أَبُو خَالِدٍ الأَحْمَرُ، سُلَيْمَانُ بْنُ حَيَّانَ عَنْ مَنْصُورِ، بْنِ حَيَّانَ عَنْ أَبِي الطُّفَيْلِ، قَالَ قُلْنَا لِعَلِيِّ بْنِ أَبِي طَالِبٍ أَخْبِرْنَا بِشَىْءٍ، أَسَرَّهُ إِلَيْكَ رَسُولُ اللَّهِ صلى الله عليه وسلم فَقَالَ مَا أَسَرَّ إِلَىَّ شَيْئًا كَتَمَهُ النَّاسَ وَلَكِنِّي سَمِعْتُهُ يَقُولُ ‏ "‏ لَعَنَ اللَّهُ مَنْ ذَبَحَ لِغَيْرِ اللَّهِ وَلَعَنَ اللَّهُ مَنْ آوَى مُحْدِثًا وَلَعَنَ اللَّهُ مَنْ لَعَنَ وَالِدَيْهِ وَلَعَنَ اللَّهُ مَنْ غَيَّرَ الْمَنَارَ ‏"‏ ‏.‏
Reference : Sahih Muslim 1978b
In-book reference : Book 35, Hadith 61
USC-MSA web (English) reference : Book 22, Hadith 4877
  (deprecated numbering scheme)