reject unsafe mongo query operators on /o/tasks and /o/slipping#7702
Merged
Conversation
Route the slipping-away-users query through common.parseUserQuery so $where/$function/$accumulator are rejected (400) instead of reaching the app_users count conditions. Follow-up to the merged reject-unsafe-query work (the /o/tasks fix from the same effort already merged; this slipping path was not yet included). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the slipping-away-users plugin’s /o/slipping endpoint by validating the user-supplied MongoDB filter query at the API boundary (follow-up to #7695), preventing unsafe operators (e.g. $where, $function, $accumulator) from reaching MongoDB.
Changes:
- Route
params.qstring.querythroughcommon.parseUserQuery()and return HTTP 400 on invalid/disallowed queries. - Add plugin-scoped logging for rejected queries.
Cookiezaurs
approved these changes
Jun 10, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These task-listing endpoints raw-parsed params.qstring.query and passed it to long_tasks find/count/aggregate without validation (the original fix from this effort never merged). Route through common.parseUserQuery (reject 400). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the merged reject-unsafe-query work (#7695). The
/o/slippingendpoint (slipping-away-users plugin) still raw-parsedparams.qstring.queryand merged it into per-periodapp_users<app_id>.countconditions without validation, so$where/$function/$accumulatorcould reach Mongo. Now routed throughcommon.parseUserQuery(reject 400). No change for valid queries.