Skip to content

fix: LiveQuery subscriptions can receive installations and objects of other internal classes without the master key (GHSA-q2gf-q36j-h978) - #10848

Merged
mtrezza merged 1 commit into
parse-community:alphafrom
mtrezza:fix/GHSA-q2gf-q36j-h978-9
Oct 30, 2026
Merged

mtrezza merged 1 commit into
parse-community:alphafrom
mtrezza:fix/GHSA-q2gf-q36j-h978-9

Conversation

@mtrezza

@mtrezza mtrezza commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Issue

LiveQuery subscriptions can receive installations and objects of other internal classes without the master key (GHSA-q2gf-q36j-h978)

Tasks

  • Add tests

@parse-github-assistant

Copy link
Copy Markdown

🚀 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. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 90bd81d7-2c18-4ab5-b061-0cb7434085cb
Commits

Reviewing files that changed from the base of the PR and between 3b5b9f8 and 0f60f8a.

Files selected for processing: 2
  • spec/vulnerabilities.spec.js
  • src/LiveQuery/ParseLiveQueryServer.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

LiveQuery now applies find-role security when clients subscribe to a class. Regression tests cover restricted installation and internal-class subscriptions, event delivery, and master-key access.

Changes: LiveQuery Subscription Authorization

Layer / File(s) Summary
Enforce find-role security for subscriptions
src/LiveQuery/ParseLiveQueryServer.ts, spec/vulnerabilities.spec.js
The subscribe handler loads app configuration and enforces the class’s find role security based on master-key status. Tests cover denied installation subscriptions, event suppression, beforeSubscribe, and attempts to update a subscription to _Installation.
Test master-only class subscriptions
spec/vulnerabilities.spec.js
Tests verify that clients without the master key cannot subscribe to listed master-only classes or receive audience and job-schedule events. Master-key clients receive _Audience and _JobSchedule events.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: Minimal · up to 0f60f

No actionable issue is established from the supplied evidence; the change is mergeable after normal checks.

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

Failed Failed checks: 2 errors

Check name Status Explanation Resolution
Title check Error The title "fix: GHSA-q2gf-q36j-h978" uses the required lowercase-prefix "fix:" and matches the security-fix intent. It does not describe the change itself, so it only partly identifies the work. The c… Capitalize the first letter after the prefix. For example, use "fix: Restrict LiveQuery installation subscriptions for client-inaccessible classes" or a similar description of the change. Keeping the advisory ID in the title is optional.
Description check Error The description contains only the default placeholder notice that no description was added. It has no Issue, Approach, or Tasks sections. The repository template requires these sections and a task che… Add the description using the repository template. Include the Issue section with the GHSA-q2gf-q36j-h978 advisory link. Add an Approach section that explains the enforceRoleSecurity change in ParseLiveQueryServer and the new tests. Complet…
Passed Passed checks: 5 passed
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Security Check Passed The pull request does not introduce a security vulnerability. It adds enforceRoleSecurity('find', className, { isMaster: client.hasMasterKey }, appConfig) at the start of LiveQuery subscription hand…
Engage In Review Feedback Passed PASS: The supplied review data reports zero actionable findings and no returned CodeRabbit review threads. No review feedback required engagement, implementation, or reviewer retraction.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.

Full details: Security Check

Explanation

The pull request does not introduce a security vulnerability. It adds enforceRoleSecurity('find', className, { isMaster: client.hasMasterKey }, appConfig) at the start of LiveQuery subscription handling, before beforeSubscribe, CLP processing, or subscription registration. The shared enforcement rejects _Installation, master-only classes, _Join:*, and other invalid internal classes for non-master clients. The existing catch path sends an error and does not register the subscription, so rejected clients cannot receive events. The added regression tests cover these cases, key-pair behavior, trigger suppression, and subscription updates.

Full details: Title check

Explanation

The title "fix: GHSA-q2gf-q36j-h978" uses the required lowercase-prefix "fix:" and matches the security-fix intent. It does not describe the change itself, so it only partly identifies the work. The changes add LiveQuery authorization regression tests and apply enforceRoleSecurity to the find operation. The title names a GHSA advisory ID, which is not descriptive of the code change. The capitalization rule is not met because the first letter after the prefix is lowercase.

Resolution

Capitalize the first letter after the prefix. For example, use "fix: Restrict LiveQuery installation subscriptions for client-inaccessible classes" or a similar description of the change. Keeping the advisory ID in the title is optional.

Full details: Description check

Explanation

The description contains only the default placeholder notice that no description was added. It has no Issue, Approach, or Tasks sections. The repository template requires these sections and a task checklist. The description is therefore largely incomplete.

Resolution

Add the description using the repository template. Include the Issue section with the GHSA-q2gf-q36j-h978 advisory link. Add an Approach section that explains the enforceRoleSecurity change in ParseLiveQueryServer and the new tests. Complete the Tasks checklist, including the tests, security check, and documentation items. Also confirm whether the Parse JS SDK error code item applies.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.50.0)
spec/vulnerabilities.spec.js

ast-grep timed out on this file

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pre-merge checks failed. Please resolve the failing checks before merging.

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.19%. Comparing base (3373ee2) to head (0f60f8a).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10848   +/-   ##
=======================================
  Coverage   94.19%   94.19%           
=======================================
  Files         193      193           
  Lines       17395    17397    +2     
  Branches      246      246           
=======================================
+ Hits        16385    16387    +2     
  Misses        989      989           
  Partials       21       21           

☔ View full report in Codecov by Harness.
📢 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-q2gf-q36j-h978 fix: LiveQuery subscriptions can receive installations and objects of other internal classes without the master key (GHSA-q2gf-q36j-h978) Oct 30, 2026
@mtrezza
mtrezza merged commit 3a1595b into parse-community:alpha Oct 30, 2026
25 checks passed
parseplatformorg pushed a commit that referenced this pull request Oct 30, 2026
## [9.10.8-alpha.3](9.10.8-alpha.2...9.10.8-alpha.3) (2026-10-30)

### Bug Fixes

* LiveQuery subscriptions can receive installations and objects of other internal classes without the master key ([GHSA-q2gf-q36j-h978](GHSA-q2gf-q36j-h978)) ([#10848](#10848)) ([3a1595b](3a1595b))
@parseplatformorg

Copy link
Copy Markdown
Contributor

🎉 This change has been released in version 9.10.8-alpha.3

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Oct 30, 2026
@mtrezza
mtrezza deleted the fix/GHSA-q2gf-q36j-h978-9 branch October 30, 2026 16:27
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