The Quran does not address masterbation directly however in the haddiths it is said to be mukrah (disliked) but not haram (forbidden) and should be done out of necessity. There is no difference between male and female.
The Quran, chapter 24 (An-Noor), verse 33 to 33: