Whoever experiences a nocturnal emission involuntarily—such as one who has a wet dream while asleep—does not break his fast by unanimous agreement. By contrast, anyone who masturbates until ejaculation does invalidate the fast.
It is proven by the Qur’an and the Sunnah that a person who commits a forbidden act in error or out of forgetfulness is not held accountable; he is regarded as though he had not done it, incurs no sin, and his act of worship is not annulled. Accordingly, if a fasting person eats, drinks, or has intercourse while forgetful or mistaken, he is not required to make up the day. This is the view of a number of early and later scholars.
As for applying kohl to the eyes, administering enemas, inserting drops into the urethra, or treating penetrating head or abdominal wounds (ma’mūmah and jā’ifah), the jurists have differed: some hold that none of these break the fast, while others say that all of them do. The stronger opinion is that they do not invalidate the fast. Fasting is a pillar of Islam that both the learned and the layman must understand; had Allah and His Messenger declared these acts forbidden for the fasting person and damaging to the fast, the Prophet ﷺ would have been obliged to clarify it, and the Companions would have learned it and conveyed it to the Ummah just as they transmitted the rest of the sacred law. Since not a single scholar has reported from the Prophet ﷺ—through a sound, weak, connected, or interrupted chain—any statement on the matter, it is clear that he never mentioned it. The lone report concerning kohl is weak.
Those who argue that these acts break the fast rely solely on analogy, and their strongest evidence is the hadith, “Exaggerate in sniffing water into the nose—except when you are fasting.” This analogy is weak, for a person who sniffs water up his nostrils causes it to reach the throat and stomach, achieving the same result as drinking by mouth: it nourishes the body and quenches thirst. Even without a text, reason alone shows that this is a form of drinking. The fasting person is forbidden to eat and drink because these strengthen the body; the same does not apply to kohl, enemas, or treating penetrating wounds, for they provide no nourishment whatsoever.
Sexual intercourse, on the other hand, is one of the two primal desires and therefore parallels eating and drinking. In the Sacred Hadith Allah says, “He leaves his desire and his food for My sake.” Abstaining from carnal desire is thus an intended act of worship for which one is rewarded. Ejaculation is a form of discharge: just as the fasting person is prohibited from taking in what strengthens and nourishes him—food and drink—he is likewise prohibited from expelling that which weakens him and drains the substance on which his body lives. Because it debilitates the body, its damage to the fast is even greater than that of eating.
The scholars disagree over cupping (ḥijāmah): does it break the fast or not? Numerous hadiths from the Prophet ﷺ state, “The cupper and the one cupped have broken their fast,” and the hadith masters have discussed them in detail. More than one Companion disliked cupping for the fasting person, and the position that it invalidates the fast is held by the majority of the hadith jurists—those most specialized in this field.