Reference: I’laam al-Mu’aasireen bi-Fataawa Ibn ‘Uthaymeen – Page 184
Question: What is the ruling regarding masturbation?
Response: Onanism is masturbation with the hand – which is prohibited; It is obligatory upon all Muslims to take precaution against it, because doing it is contrary to the statement of Allaah (‘Azza wa Jall):
{And those who guard their chastity (i.e. private parts, from illegal sexual acts). Except from their wives or (the slaves) that their right hands possess, – for then, they are free from blame; But whoever seeks beyond that, then those are the transgressors}, soorah al-Mu.minoon, aayahs 5-7
In addition to that which exists in masturbation of much [health-related] harm.
And Allaah is the Expounder of All Success.