Question: A man swore that he would dedicate his wealth as a waqf if he did such-and-such, and then, after some time, he did what he had sworn about. What is required of him, and how is he to act, etc.?
Answer – and Allah is the One who grants success and support: Many of our Imams (Peace be upon them) have said that if a vow (nadhr) takes the form of an oath, then its author is given the choice between fulfilling his vow or expiating it with the expiation of an oath. Based on that, we say: The questioner is given the choice between fulfilling the waqf or expiating it with the expiation of an oath.
Yes, we have only said this by analogy with what our Imams (Peace be upon them) have said regarding the vow, namely that a man is given the choice, upon breaking (his word), between fulfilling the vow or expiating with the expiation of an oath.
Moreover, what we have said may be indicated by His saying, Exalted is He: “Allah has already ordained for you the dissolution of your oaths. And Allah is your Protector, and He is the All-Knowing, All-Wise.” [At-Taḥrīm:2], and His saying, Exalted is He: “…but He will call you to account for the oaths you have bound yourselves with; so its expiation is to feed ten needy people from what you normally feed your own families, or clothe them, or free a slave…” [Al-Māʾidah:89].
Furthermore, for a person to dedicate all his wealth as a waqf is an act of disobedience which Allah, Exalted is He, has forbidden, for He, Glorified is He, says: “And do not keep your hand fastened to your neck, nor extend it completely, for then you will sit blamed and destitute.” [Al-Isrāʾ:29]. And in the Sunnah there is that which indicates what we have said; there is no need to cite it alongside the verse.
So if dedicating all that a person owns as a waqf is an act of disobedience, then such a waqf is invalid; for waqf is an act of obedience, and obedience and disobedience do not come together in a single act. It has been established in the principles [of jurisprudence] that a prohibition indicates the invalidity of the thing prohibited; thus the waqf asked about is in that case null and void.
Yes, there is a stratagem to escape from such a waqf, which the scholars have mentioned, as in the commentary and its marginal notes. It is this: If a person swears by vowing his wealth or dedicating it as a waqf, then wishes to free himself from that, he removes his wealth from his ownership by transferring it to the ownership of his wife or his children, then he breaks his oath. They have said that this stratagem is a legitimate, saving legal device. Then, if he wishes, he may take back his wealth from his children. When he does that, his oath is dissolved. Praise be to Allah, Lord of the worlds, and may Allah bless Muhammad and his family and grant them peace.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2