Skip to content

fix: LiveQuery subscription query depth bypass (GHSA-6qh5-m6g3-xhq6)#10259

Merged
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/GHSA-6qh5-m6g3-xhq6-v9
Mar 20, 2026
Merged

fix: LiveQuery subscription query depth bypass (GHSA-6qh5-m6g3-xhq6)#10259
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/GHSA-6qh5-m6g3-xhq6-v9

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Mar 20, 2026

Issue

LiveQuery subscription query depth bypass (GHSA-6qh5-m6g3-xhq6)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Mar 20, 2026

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement.

@parseplatformorg
Copy link
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

This pull request adds query depth validation to LiveQuery subscriptions by implementing pre-permission checks in ParseLiveQueryServer._handleSubscribe. When requestComplexity.queryDepth is configured, the server recursively validates that nested $or, $and, and $nor patterns don't exceed the configured maximum depth, rejecting violations with INVALID_QUERY errors. Comprehensive tests cover validation behavior across depth constraints.

Changes

Cohort / File(s) Summary
LiveQuery Subscription Tests
spec/vulnerabilities.spec.js
Added test suite for GHSA-6qh5-m6g3-xhq6 covering LiveQuery subscribe behavior under requestComplexity.queryDepth constraints, including depth validation failures for deeply nested $or/$and/$nor patterns, positive cases within limits, and disabled depth checks.
LiveQuery Server Validation
src/LiveQuery/ParseLiveQueryServer.ts
Implemented pre-permission query depth validation in _handleSubscribe that recursively inspects where clause for $or/$and/$nor patterns and enforces configured queryDepth limits before CLP operation checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is missing entirely. The required template specifies sections for Issue, Approach, and Tasks that should be completed. Add a pull request description following the template with details about the vulnerability (Issue), implementation approach, and applicable tasks (tests added, documentation, security checks).
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly describes the main change: fixing a LiveQuery subscription query depth bypass vulnerability (GHSA-6qh5-m6g3-xhq6), which matches the core modification adding depth validation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.55%. Comparing base (85994ef) to head (0f858e1).
⚠️ Report is 3 commits behind head on alpha.

Files with missing lines Patch % Lines
src/LiveQuery/ParseLiveQueryServer.ts 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10259      +/-   ##
==========================================
+ Coverage   92.54%   92.55%   +0.01%     
==========================================
  Files         192      192              
  Lines       16417    16431      +14     
  Branches      221      226       +5     
==========================================
+ Hits        15193    15208      +15     
+ Misses       1205     1203       -2     
- Partials       19       20       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mtrezza mtrezza changed the title fix: GHSA-6qh5-m6g3-xhq6 v9 fix: LiveQuery subscription query depth bypass (GHSA-6qh5-m6g3-xhq6) Mar 20, 2026
@mtrezza mtrezza merged commit 2126fe4 into parse-community:alpha Mar 20, 2026
21 of 24 checks passed
parseplatformorg pushed a commit that referenced this pull request Mar 20, 2026
# [9.6.0-alpha.45](9.6.0-alpha.44...9.6.0-alpha.45) (2026-03-20)

### Bug Fixes

* LiveQuery subscription query depth bypass ([GHSA-6qh5-m6g3-xhq6](GHSA-6qh5-m6g3-xhq6)) ([#10259](#10259)) ([2126fe4](2126fe4))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 9.6.0-alpha.45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants