Sahih Muslim #2601 a
The Book of Virtue, Enjoining Good Manners, and Joining of the Ties of Kinship 45:114
Abu Huraira reported Allah's Messenger (ﷺ) as saying:
O Allah, I am a human being and for any person amongst Muslims upon whom I hurl malediction or invoke curse or give him whipping make it a source of purity and mercy.