Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS-13914: Validate vote arguments for voter edit search #3464

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

reosarevok
Copy link
Member

Fix MBS-13914

Problem

A link such as /search/edits?conditions.0.args=&conditions.0.field=voter&conditions.0.name=aerozol&conditions.0.operator=%3D&conditions.0.voter_id=463559 causes an ISE when logged in - it seems to be caused by the empty conditions.0.args= leading to an empty WHERE () in the query. It seems this can probably only be hit by manually editing the URL (since just deselecting all the vote options removes args entirely and was already being caught as invalid).

Solution

It seems any argument that is not a valid vote option or "no" (which we use for searching for lack of votes) should just be deemed invalid and reject the search, so this checks the arguments against the valid list and rejects any that don't match.

Testing

Manually.

This was causing ISEs when the passed argument was '' since
the query could crash with WHERE ().
But more generally, it seems any argument that is not a valid vote option
or "no" (which we use for searching for lack of votes) should just be deemed
invalid and reject the search, so this does that.
@reosarevok reosarevok added Bug Bugs that should be checked/fixed soonish Edit search labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bugs that should be checked/fixed soonish Edit search
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant