كتاب الأضاحى
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 c

Abu Tufail reported:

'Ali was asked whether Allah's Messenger (ﷺ) had showed special favour (by disclosing to him) a thing (which he kept secret from others). Thereupon he said: Allah's Messenger (ﷺ) singled us not for (disclosing to us) anything (secret) which he did not make public, (but those few things) which lie in the sheath of my sword. He drew out the written document contained in it and on that (it was mentioned): Allah cursed him who sacrificed for anyone else besides Allah; and Allah cursed him who stole the signposts (demarcating the boundary lines of the) land; and Allah cursed him who cursed his father; and Allah cursed him who accommodated an innovator (in religion).
حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، وَمُحَمَّدُ بْنُ بَشَّارٍ، - وَاللَّفْظُ لاِبْنِ الْمُثَنَّى - قَالاَ حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، قَالَ سَمِعْتُ الْقَاسِمَ بْنَ أَبِي بَزَّةَ، يُحَدِّثُ عَنْ أَبِي الطُّفَيْلِ، قَالَ سُئِلَ عَلِيٌّ أَخَصَّكُمْ رَسُولُ اللَّهِ صلى الله عليه وسلم بِشَىْءٍ فَقَالَ مَا خَصَّنَا رَسُولُ اللَّهِ صلى الله عليه وسلم بِشَىْءٍ لَمْ يَعُمَّ بِهِ النَّاسَ كَافَّةً إِلاَّ مَا كَانَ فِي قِرَابِ سَيْفِي هَذَا - قَالَ - فَأَخْرَجَ صَحِيفَةً مَكْتُوبٌ فِيهَا ‏ "‏ لَعَنَ اللَّهُ مَنْ ذَبَحَ لِغَيْرِ اللَّهِ وَلَعَنَ اللَّهُ مَنْ سَرَقَ مَنَارَ الأَرْضِ وَلَعَنَ اللَّهُ مَنْ لَعَنَ وَالِدَهُ وَلَعَنَ اللَّهُ مَنْ آوَى مُحْدِثًا ‏"‏ ‏.‏
Reference : Sahih Muslim 1978 c
In-book reference : Book 35, Hadith 62
USC-MSA web (English) reference : Book 22, Hadith 4878
  (deprecated numbering scheme)