Skip to content

reject unsafe mongo query operators on /o/tasks and /o/slipping#7702

Merged
ar2rsawseen merged 3 commits into
masterfrom
followup/reject-unsafe-slipping
Jun 10, 2026
Merged

reject unsafe mongo query operators on /o/tasks and /o/slipping#7702
ar2rsawseen merged 3 commits into
masterfrom
followup/reject-unsafe-slipping

Conversation

@ar2rsawseen

Copy link
Copy Markdown
Member

Follow-up to the merged reject-unsafe-query work (#7695). The /o/slipping endpoint (slipping-away-users plugin) still raw-parsed params.qstring.query and merged it into per-period app_users<app_id>.count conditions without validation, so $where/$function/$accumulator could reach Mongo. Now routed through common.parseUserQuery (reject 400). No change for valid queries.

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>
Copilot AI review requested due to automatic review settings June 10, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.query through common.parseUserQuery() and return HTTP 400 on invalid/disallowed queries.
  • Add plugin-scoped logging for rejected queries.

Comment thread plugins/slipping-away-users/api/api.js
Comment thread plugins/slipping-away-users/api/api.js
ar2rsawseen and others added 2 commits June 10, 2026 22:28
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>
@ar2rsawseen ar2rsawseen changed the title reject unsafe mongo query operators on /o/slipping reject unsafe mongo query operators on /o/tasks and /o/slipping Jun 10, 2026
@ar2rsawseen ar2rsawseen merged commit b79cd72 into master Jun 10, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants