Anyone found guilty of masturbation may be decapitated.
Masturbation is classified as a sin under Islamic law, which Indonesia has incorporated into its legal system. Technically, Indonesian law outlaws any “immoral behavior”, which this action would fall under.
Sources indicate that while the punishment of decapitation may have once been enforced (in theory, they would have had to catch you masturbating, so maybe this is more of a public-indecency issue), the current law may be along the lines of 2 years 8 months in prison.