Narrated Abdullah ibn Abbas:The Messenger of Allah (ﷺ) had himself cupped in his head when he was in the sacred state (wearing ihram due to a disease from which he was suffering.
حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ، أَخْبَرَنَا هِشَامٌ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم احْتَجَمَ وَهُوَ مُحْرِمٌ فِي رَأْسِهِ مِنْ دَاءٍ كَانَ بِهِ .
AbuDaud
The Rites of Hajj (Kitab Al-Manasik Wa'l-Hajj) • Hadith 1836