The Prophet (ﷺ) prohibited the earnings of slave girls (through prostitution).

Sahih al-Bukhari Book 37 Hadith 23

Sahih al-Bukhari #2283

Hiring 37:23

Narrated Abu Huraira:

The Prophet (ﷺ) prohibited the earnings of slave girls (through prostitution).

Chapter: The earnings of prostitutes and female-slaves

Grade: Sahih