The Prophet ﷺ had himself cupped on the upper part of his foot while he was in the state of ihram, due to a pain he was suffering from.
حدثنا عبد الرزاق أخبرنا معمر عن قتادة
أن النبي ﷺ احتجم وهو محرم على ظهر القدم من وجع كان به
Its isnad is sahih. Bukhari narrated the hadith in 10/153 no. 5700 (Fath), in the Book of Medicine, section on cupping for migraine and headache. And Abu Dawud narrated it in 2/168 no. 1837, in the Book of Rites, section on the one in Muharram state cupping.