fix: GraphQL error messages disclose required input field names when public introspection is disabled (GHSA-2fgh-8j2g-w354)#10566
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. 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. |
📝 WalkthroughWalkthroughGraphQL error sanitization now redacts required custom field identifiers from restricted base and inline-literal coercion errors, including serialized stacktraces, while preserving identifiers for master-key requests and public introspection. ChangesGraphQL error redaction
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (2 errors)
✅ Passed checks (5 passed)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10566 +/- ##
==========================================
- Coverage 92.68% 92.67% -0.02%
==========================================
Files 193 193
Lines 16986 16990 +4
Branches 248 248
==========================================
+ Hits 15743 15745 +2
- Misses 1222 1224 +2
Partials 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
spec/ParseGraphQLServer.spec.js (1)
1235-1266: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winAdd coverage for the inline-literal coercion path, not just the variable path.
All three tests pass the required field through a query variable (
$input), so they only exercise graphql-js's variable-coercion branch, which emitsField "secretRequiredField" of required type .... The inline-literal branch (input written directly in the operation, validated byValuesOfCorrectTypeRule) emits a different string that additionally discloses the class-derived type name:Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.Your regex does cover it, but nothing in the suite proves it. Since this is a security control, add a variant that sends the mutation with inline input and asserts neither
TestReqClassnorsecretRequiredFieldappears in the serialized error. Otherwise a future edit that narrows the regex to the variable-only form would pass CI while re-opening half the disclosure surface.🤖 Prompt for 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. In `@spec/ParseGraphQLServer.spec.js` around lines 1235 - 1266, Add a separate test alongside the existing required-field coercion coverage that invokes createTestReqClass with the input object written directly in the mutation rather than via $input. Capture the resulting error with getReturnedError and assert the serialized error contains neither TestReqClass nor secretRequiredField, covering the ValuesOfCorrectTypeRule inline-literal path.
🤖 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.
Nitpick comments:
In `@spec/ParseGraphQLServer.spec.js`:
- Around line 1235-1266: Add a separate test alongside the existing
required-field coercion coverage that invokes createTestReqClass with the input
object written directly in the mutation rather than via $input. Capture the
resulting error with getReturnedError and assert the serialized error contains
neither TestReqClass nor secretRequiredField, covering the
ValuesOfCorrectTypeRule inline-literal path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 862257b3-b752-4a7e-9f97-4a1da728b98d
📒 Files selected for processing (2)
spec/ParseGraphQLServer.spec.jssrc/GraphQL/ParseGraphQLServer.js
|
@coderabbitai review |
✅ Action performedReview finished.
|
# [9.10.0-alpha.5](9.10.0-alpha.4...9.10.0-alpha.5) (2026-07-10) ### Bug Fixes * GraphQL error messages disclose required input field names when public introspection is disabled ([GHSA-2fgh-8j2g-w354](GHSA-2fgh-8j2g-w354)) ([#10566](#10566)) ([d96c945](d96c945)), closes [GHSA-2f#8j2g-w354](https://github.com/GHSA-2f/issues/8j2g-w354) [/github.com/parse-community/parse-server/security/advisories/GHSA-2f#8j2g-w354](https://github.com//github.com/parse-community/parse-server/security/advisories/GHSA-2f/issues/8j2g-w354)
|
🎉 This change has been released in version 9.10.0-alpha.5 |
Issue
GraphQL error messages disclose required input field names when public introspection is disabled (GHSA-2fgh-8j2g-w354)
Tasks