The Messenger of Allah ﷺ ruled that the earnings of a slave belong to whoever bears the responsibility for him.
حدثنا أبو بكر بن أبي شيبة وعلي بن محمد قالا حدثنا وكيع عن ابن أبي ذئب عن مخلد بن خفاف بن إيماء بن رحضة الغفاري عن عروة بن الزبير
أن رسول الله ﷺ قضى أن خراج العبد بضمانه
[Its isnad is hasan]. Abu Dawud narrated it in the Book of Sales, in the chapter on one who buys a slave, uses him, then discovers a defect in him, hadith no. 3508, 3509, from the hadith of Ibn Abu Dhib, with this wording. Tirmidhi graded it sahih, hadith no. 1285, as did Ibn Jarud, hadith no. 627, and Ibn Hibban, hadith no. 1125, and others.