Is it permissible in a misyaar marriage for the wife to forfeit the right to inheritance at the time of writing the marriage contract, if her husband dies when she is still married to him?.
If the misyaar marriage fulfils the conditions and necessary parts of marriage and is free of any impediments, then it is a valid marriage in which all the consequences of marriage take effect, including inheritance. So each spouse inherits from the other. If one of the spouses stipulates that the other should forfeit his or her inheritance in the event of death, this stipulation is not valid because the legacy cannot be taken possession of until after the death of the one from whom it is inherited. Forfeiting it before that is forfeiting something that one does not possess. But if this forfeiting comes after becoming entitled to the inheritance, which is after the death of the person concerned, and is done willingly and freely by the one who is forfeiting it, then it is permissible.
Shaykh Bakri al-Sadafi (may Allah have mercy on him), the former Mufti of Egypt, said: If they get married on condition that one will not inherit from the other if he or she dies, this condition carries no weight and either inherits from the other if he or she dies.
End quote from Fataawa al-Azhar.
And Allah knows best.