Page MenuHomePhabricator

Prevent users from voting for invalid Slowvote options
ClosedPublic

Authored by epriestley on Nov 5 2018, 6:23 PM.

Details

Summary

Depends on D19773. See https://hackerone.com/reports/434116. You can currently vote for invalid options by submitting, e.g., vote[]=12345.

By doing this, you can see the responses, which is sort of theoretically a security problem? This is definitely a bug, regardless.

Instead, only allow users to vote for options which are actually part of the poll.

Test Plan
  • Tried to vote for invalid options by editing the form to vote[]=12345 (got error).
  • Tried to vote for invalid options by editing the radio buttons on a plurality poll into checkboxes, checking multiple boxes, and submitting (got error).
  • Voted in approval and plurality polls the right way, from the main web UI and from the embed ({V...}) UI.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Nov 5 2018, 6:23 PM
epriestley requested review of this revision.Nov 5 2018, 6:24 PM
amckinley accepted this revision.Nov 6 2018, 4:22 PM
This revision is now accepted and ready to land.Nov 6 2018, 4:22 PM
This revision was automatically updated to reflect the committed changes.