كتاب الحج
15  
The Book of Pilgrimage
(65)
Chapter: It is permissible to ride the sacrificial animal if necessary
(65)
باب جَوَازِ رُكُوبِ الْبَدَنَةِ الْمُهْدَاةِ لِمَنِ احْتَاجَ إِلَيْهَا ‏‏
Sahih Muslim 1323 b

Anas reported:

Someone happened to pass by Allah's Apostle (ﷺ) with a sacrificial camel, or a sacrificial animal, whereupon he said: Ride on it. He said: It is a sacrificial camel, or animal, whereupon he said: (Ride) even if (it is a sacrificial camel).
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا وَكِيعٌ، عَنْ مِسْعَرٍ، عَنْ بُكَيْرِ بْنِ الأَخْنَسِ، عَنْ أَنَسٍ، قَالَ سَمِعْتُهُ يَقُولُ مُرَّ عَلَى النَّبِيِّ صلى الله عليه وسلم بِبَدَنَةٍ أَوْ هَدِيَّةٍ فَقَالَ ‏"‏ ارْكَبْهَا ‏"‏ ‏.‏ قَالَ إِنَّهَا بَدَنَةٌ أَوْ هَدِيَّةٌ ‏.‏ فَقَالَ ‏"‏ وَإِنْ ‏"‏ ‏.‏
Reference : Sahih Muslim 1323b
In-book reference : Book 15, Hadith 416
USC-MSA web (English) reference : Book 7, Hadith 3050
  (deprecated numbering scheme)