"And those who guard their chastity (i.e. private parts, from illegal sexual acts). Except from their wives or (the captives and slaves) that their right hands possess, - for them, they are free from blame. But whoever seeks beyond that, then those are the transgressors." - Quran (Chapter 23 Verses 5-7)
When scholars are asked whether masturbation is haram or not, they usually refer to these verses. So basically, this means masturbation counts as using your private parts to perform illegal sexual acts. Does this mean masturbation breaks chastity?