I was with Jareer at Bawazij when the herdsman came with the cattle, among which was a cow that did not belong to the herd.Jareer asked him, "What is this?"He replied, "It joined the cattle, and we do not know whose it is."Jareer said, "Take it out, for I heard the Messenger of Allah ﷺ say, 'Only one who has gone astray gives shelter to a stray animal.'"
حدثنا عمرو بن عون أخبرنا خالد عن أبي حيان التيمي
كنت مع جرير بالبوازيج فجاء الراعي بالبقر وفيها بقرة ليست منها فقال له جرير ما هذه قال لحقت بالبقر لا ندري لمن هي فقال جرير أخرجوها فقد سمعت رسول الله ﷺ يقول لا يأوي الضالة إلا ضال
No references are available.
[Sahih]. The hadith also has another route in Ibn Majah, no. 2503, and it has a corroborating witness in Muslim, no. 1725, and through it the hadith is confirmed as sahih.