The legal ruling regarding the contradiction between the hadith prohibiting cupping while fasting and the hadith stating the Prophet performed cupping while fasting.
General Chapter
Al-Mughni
Book of Fasting
Primary text
The hadith stating, "The cupper and the one cupped have broken their fast," is the governing text, and the opposing hadith where the Prophet performed cupping while fasting is abrogated. The evidence for abrogation is the report that when the Prophet performed cupping while fasting and felt severe weakness, he prohibited cupping for the fasting person. Ibn 'Abbas, the narrator of the apparently contradictory hadith, himself later acted by having cupping performed only after sunset, which signifies his understanding of the abrogation.
Supporting text
It is argued that the Prophet performing cupping while fasting and subsequently feeling weakness implies that he might have broken his fast, similar to how vomiting is mentioned to break the fast. If it is argued that the prohibition was due to the Prophet and the cupper engaging in backbiting (ghiba) after the cupping, this argument is rejected because the authenticity of that specific narration is unproven, and the general wording of the prohibition should prevail over a specific, unproven cause. Moreover, backbiting is universally agreed upon not to invalidate the fast, rendering reliance on it as the cause invalid.