Skip to content

test: LiveQuery cross-origin connections receive only public-read data#10504

Merged
mtrezza merged 3 commits into
parse-community:alphafrom
mtrezza:tests/GHSA-29c9-jfxx-gr4w-v9
Jun 13, 2026
Merged

test: LiveQuery cross-origin connections receive only public-read data#10504
mtrezza merged 3 commits into
parse-community:alphafrom
mtrezza:tests/GHSA-29c9-jfxx-gr4w-v9

Conversation

@mtrezza

@mtrezza mtrezza commented Jun 13, 2026

Copy link
Copy Markdown
Member

Issue

LiveQuery cross-origin connections receive only public-read data

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 Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57ac4469-713b-4537-85e9-fd677f756b1c

📥 Commits

Reviewing files that changed from the base of the PR and between c214676 and e5cab7e.

📒 Files selected for processing (1)
  • spec/ParseLiveQuery.spec.js

📝 Walkthrough

Walkthrough

Adds a test suite in spec/ParseLiveQuery.spec.js that uses raw WebSocket clients to exercise LiveQuery authorization by connecting without a sessionToken, subscribing to queries, and asserting which create events are delivered based on ACLs.

Changes

LiveQuery cross-origin authorization tests

Layer / File(s) Summary
WebSocket helpers and lifecycle
spec/ParseLiveQuery.spec.js
Adds helpers to open raw LiveQuery WebSocket clients, send connect/subscribe frames, wait for connected/subscribed counts, and collect create event objectIds.
Cross-origin ACL authorization test
spec/ParseLiveQuery.spec.js
Adds a test that connects without a sessionToken, subscribes to CrossOriginChat, creates public and private ACL objects, and asserts the anonymous socket receives only the public create events in the expected order.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • parse-community/parse-server#10133: Also adds LiveQuery authorization tests in spec/ParseLiveQuery.spec.js, validating subscription-time and emitted-event permission behavior.
🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is missing entirely. The template requires sections for Issue, Approach, and Tasks, but none were provided by the author. Add a pull request description following the repository template, including sections for Issue, Approach, and appropriate task checkboxes.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title begins with the required 'test:' prefix and clearly describes the main change: testing LiveQuery cross-origin connections to ensure they receive only publicly readable data.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 PR adds a test-only LiveQuery cross-origin authorization suite using raw ws clients; it has no eval/child_process/file writes and validates ACL/public-read behavior via JSON.parse and Parse saves w...
Engage In Review Feedback ✅ Passed CodeRabbit requested removing fixed sleep(300) and using deterministic assertions; current PR test replaces timing with waitFor/sleep(20) and exact createdIds ordering checks.

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

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.22.0)

OpenGrep fatal error (exit code 2): [00.13][ERROR]: Error: exception Unix_error: No such file or directory stat spec/ParseLiveQuery.spec.js
Raised by primitive operation at UTmp.replace_named_pipe_by_regular_file_if_needed in file "libs/commons/UTmp.ml", line 145, characters 8-27
Called from Scan_CLI.replace_target_roots_by_regular_files_where_needed.(fun) in file "src/osemgrep/cli_scan/Scan_CLI.ml", lines 1086-1087, characters 19-65
Called from List_.fast_map in file "libs/commons/List_.ml", line 81, characters 17-20
Called from


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.

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@spec/ParseLiveQuery.spec.js`:
- Around line 1808-1810: The test currently uses a fixed sleep(300) which only
proves no create arrived within that window; replace this timing-based check by
keeping the socket open until after a known-public save and then assert the
exact list of created IDs from attacker.createdIds() (and/or check
attacker.countOp('create') equals the expected count) to ensure the private
secretObj.id was never emitted; specifically remove reliance on sleep(300) and
instead perform a public save (e.g., savePublicObj or the existing public save
helper used elsewhere) and then assert that attacker.createdIds() does not
include secretObj.id and equals the precise expected ID array.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 99832040-7299-42e3-bcbc-67b802e8a0f5

📥 Commits

Reviewing files that changed from the base of the PR and between 576f4f6 and f919a14.

📒 Files selected for processing (1)
  • spec/ParseLiveQuery.spec.js

Comment thread spec/ParseLiveQuery.spec.js Outdated
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.61%. Comparing base (f861210) to head (e5cab7e).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10504   +/-   ##
=======================================
  Coverage   92.61%   92.61%           
=======================================
  Files         193      193           
  Lines       16947    16947           
  Branches      240      240           
=======================================
  Hits        15696    15696           
  Misses       1228     1228           
  Partials       23       23           

☔ 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.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 13, 2026
@mtrezza mtrezza merged commit 30f1612 into parse-community:alpha Jun 13, 2026
23 of 24 checks passed
@mtrezza mtrezza deleted the tests/GHSA-29c9-jfxx-gr4w-v9 branch June 13, 2026 21:17
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.

1 participant