Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, says: “Masturbation is generally considered forbidden in Islam since it is deemed to fall under the category of sexual satisfaction outside the framework of marriage.
According to the Qur’an, those who seek fulfilment outside the framework of marriage are deemed transgressors. Referring to this, Allah Almighty says: “Those who guard their sexual organs except with their spouses or those whom their right hands possess, for (with regard to them) they are without blame. But those who crave something beyond that are transgressors.” (Al-Mu’minoon:5-7)
While explaining this verse, one often finds the commentators listing masturbation under the list of the forbidden categories of sexual fulfilment.
What we have stated above is the generally accepted view. However, according to some scholars, if a person is so tormented by his intense sexual desire or craving that he fears falling into Zina (fornication), in such a case, masturbation is permitted as the lesser of the two evils. His case may be compared to that of a person who is permitted to eat pork because of fear of death by starvation.
However, having mentioned the above, we must state that one hardly needs to resort to it when we recognize the relatively flexible approach towards marriage that Islam adopts. Unfortunately, against the clear teachings of Islam, marriage has been rendered another difficult process today due to warped customs and conventions and undue expectations.
When we approach marriage from the point of view of pristine Islam, we shall find less and less people being forced to exercise the above type of exceptional rulings.”
Now, we do advise such person to:

  1. bring themself closer to Allah by means of observing the religious duties, reading Qur’an, making Dhikr, etc.
  2. frequently visit the Islamic center and attend Islamic lectures and activities.
  3. encircle themself with good Muslim companions
  4. involve themself in beneficial activities such reading, volunteering activities, etc.
  5. try to admire the beautiful nature and creations of Allah, and ponder on Allah’s miraculous creation.
  6. make du`aa’ to Allah to help them keep away from such evils

Having stated the above, we would like to make it clear that there is no kafarah (ransom) for committing masturbation. It is simply enough for her to ask forgiveness of Allah and make a firm resolution in her mind never to repeat the same again, and promise herself and Allah to stick with it.