Question:
If a slave apostatizes from Islam, what is his punishment?
Answer:
Whoever leaves the religion of Islam and becomes an apostate, his punishment is execution. This is the legal hadd punishment prescribed by the Shariah for the apostate, and in this the free person, the slave, the man and the woman are all equal.
Sayyidina Abdullah ibn Abbas (may Allah be pleased with them both) reports that the Messenger of Allah ﷺ said:
من بدل دينه فاقتلوه
Whoever changes his religion (Islam), kill him.
This hadith is general; the male slave and the female slave are also included in it, and it cannot be restricted without a proof from the Shariah.
❀ Hafiz Ibn Hajar (may Allah have mercy on him)
says:
إن الإجماع انعقد على أن العبد والحر فى الردة سواء
Consensus has been established that the slave and the free person are equal with regard to (the punishment for) apostasy.
Remember that the enforcement of punishments is the responsibility of the Islamic state. No individual is permitted to take the law into his own hands; this is corruption on the earth, and Islam absolutely does not permit it. If the state does not enforce a prescribed hadd punishment, then it is the officials of the state who will be held accountable on the Day of Resurrection. Therefore, the duty of the public is only to demand the enforcement of the limits of Allah; establishing the hudud is not their task.