Riding a tsunami of moral conservatism and anti-gay prejudice, Indonesia’s Islamic political parties appear on the cusp of a major victory: outlawing all sex outside marriage.

Revisions to Indonesia’s criminal code being considered by Parliament would allow prison sentences of up to five years for sex between unmarried people. Those changes would also criminalize gay sex, the bugbear of Indonesia’s Islamic and secular political parties.

Rights groups and legal experts fear a profound setback to human rights and privacy in Indonesia, one of the world’s largest democracies, and the spread of vigilantism, already common in parts of the sprawling Muslim-majority nation of more than 250 million people. They are racing to organize opposition. An online petition launched this week has gathered more than 20,000 signatures.