The Prophet (ﷺ) forbade taking the earnings of a slave girl by prostitution.

Sahih al-Bukhari Book 68 Hadith 93

Sahih al-Bukhari #5348

Divorce 68:93

Narrated Abu Huraira:

The Prophet (ﷺ) forbade taking the earnings of a slave girl by prostitution.

Chapter: The earnings of a prostitute and the illegal wedding.

Grade: Sahih