The Messenger of Allah ﷺ said, "An animal that is pledged as collateral may be ridden in exchange for its upkeep, and the milk of a milking animal pledged as collateral may be drunk in exchange for its upkeep. The one who drinks the milk and rides the animal must bear the cost of its upkeep."
حدثنا يحيى عن زكريا قال حدثني عامر
قال رسول الله ﷺ الظهر يركب بنفقة إذا كان مرهونا ويشرب لبن الدر إذا كان مرهونا وعلى الذي يشرب ويركب نفقته
Its isnad is sahih, and it is found in Bukhari 5/143, no. 2512 (Fath), in the chapter on pledges, "The pledged animal may be ridden and milked," and in Tirmidhi 4/546, no. 1254, where he said, hasan sahih, and in Ibn Majah 2/816, no. 2440.In H, it reads "for its expense," which may in fact be clearer in meaning, that is, the owner of the pledge rides it in exchange for its upkeep and feeding.