fix: Cloud Code trigger context vulnerable to prototype pollution#10352
Conversation
|
🚀 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
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. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR hardens Cloud Code trigger request context against prototype pollution (GHSA-445j-ww4h-339m) by creating context objects with null prototypes and adds tests exercising header/body injection vectors to verify the fix. Changes
Sequence Diagram(s)(omitted — changes do not introduce a multi-component sequential flow requiring visualization) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@spec/vulnerabilities.spec.js`:
- Around line 5467-5535: The tests currently swallow request errors and then
allow assertions to pass if the cloud trigger never ran
(contextInTrigger/contextAfterDelete undefined); change each test to assert the
HTTP request succeeded and that the trigger executed before checking properties:
remove the .catch(e=>e) pattern on the await request calls (or capture the
response and assert a successful status), and add explicit assertions like
expect(contextInTrigger).toBeDefined() (for tests using contextInTrigger) and
expect(contextAfterDelete).toBeDefined() (for the deletion test) immediately
after the request to ensure Parse.Cloud.beforeSave handlers ran before asserting
prototype pollution checks.
🪄 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: e6f08268-7fd0-48f3-812d-ea5ef5005718
📒 Files selected for processing (2)
spec/vulnerabilities.spec.jssrc/triggers.js
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10352 +/- ##
=======================================
Coverage 92.50% 92.50%
=======================================
Files 192 192
Lines 16552 16552
Branches 231 231
=======================================
Hits 15312 15312
Misses 1218 1218
Partials 22 22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
# [9.7.0-alpha.17](9.7.0-alpha.16...9.7.0-alpha.17) (2026-03-29) ### Bug Fixes * Cloud Code trigger context vulnerable to prototype pollution ([#10352](#10352)) ([d5f5128](d5f5128))
|
🎉 This change has been released in version 9.7.0-alpha.17 |
# [9.7.0](9.6.1...9.7.0) (2026-03-30) ### Bug Fixes * Auth data exposed via verify password endpoint ([GHSA-wp76-gg32-8258](GHSA-wp76-gg32-8258)) ([#10323](#10323)) ([770be86](770be86)) * Batch login sub-request rate limit uses IP-based keying ([#10349](#10349)) ([63c37c4](63c37c4)) * Cloud Code trigger context vulnerable to prototype pollution ([#10352](#10352)) ([d5f5128](d5f5128)) * Cloud function validator bypass via prototype chain traversal ([GHSA-vpj2-qq7w-5qq6](GHSA-vpj2-qq7w-5qq6)) ([#10342](#10342)) ([dc59e27](dc59e27)) * Duplicate session destruction can cause unhandled promise rejection ([#10319](#10319)) ([92791c1](92791c1)) * GraphQL API endpoint ignores CORS origin restriction ([GHSA-q3p6-g7c4-829c](GHSA-q3p6-g7c4-829c)) ([#10334](#10334)) ([4dd0d3d](4dd0d3d)) * GraphQL complexity validator exponential fragment traversal DoS ([GHSA-mfj6-6p54-m98c](GHSA-mfj6-6p54-m98c)) ([#10344](#10344)) ([f759bda](f759bda)) * LiveQuery protected field leak via shared mutable state across concurrent subscribers ([GHSA-m983-v2ff-wq65](GHSA-m983-v2ff-wq65)) ([#10330](#10330)) ([776c71c](776c71c)) * LiveQuery protected-field guard bypass via array-like logical operator value ([GHSA-mmg8-87c5-jrc2](GHSA-mmg8-87c5-jrc2)) ([#10350](#10350)) ([f63fd1a](f63fd1a)) * Maintenance key blocked from querying protected fields ([#10290](#10290)) ([7c8b213](7c8b213)) * MFA single-use token bypass via concurrent authData login requests ([GHSA-w73w-g5xw-rwhf](GHSA-w73w-g5xw-rwhf)) ([#10326](#10326)) ([e7efbeb](e7efbeb)) * Missing error messages in Parse errors ([#10304](#10304)) ([f128048](f128048)) * Postgres query on non-existent column throws internal server error ([#10308](#10308)) ([c5c4325](c5c4325)) * Session field immutability bypass via falsy-value guard ([GHSA-f6j3-w9v3-cq22](GHSA-f6j3-w9v3-cq22)) ([#10347](#10347)) ([9080296](9080296)) ### Features * Add `protectedFieldsSaveResponseExempt` option to strip protected fields from save responses ([#10289](#10289)) ([4f7cb53](4f7cb53)) * Add `protectedFieldsTriggerExempt` option to exempt Cloud Code triggers from `protectedFields` ([#10288](#10288)) ([1610f98](1610f98)) * Add support for `partialFilterExpression` in MongoDB storage adapter ([#10346](#10346)) ([8dd7bf2](8dd7bf2)) * Extend storage adapter interface to optionally return `matchedCount` and `modifiedCount` from `DatabaseController.update` with `many: true` ([#10353](#10353)) ([aea7596](aea7596))
|
🎉 This change has been released in version 9.7.0 |
Issue
Cloud Code trigger context vulnerable to prototype pollution
Tasks