Skip to content

fix: Session field immutability bypass via falsy-value guard (GHSA-f6j3-w9v3-cq22)#10347

Merged
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/GHSA-f6j3-w9v3-cq22-v9
Mar 29, 2026
Merged

fix: Session field immutability bypass via falsy-value guard (GHSA-f6j3-w9v3-cq22)#10347
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/GHSA-f6j3-w9v3-cq22-v9

Conversation

@mtrezza
Copy link
Copy Markdown
Member

@mtrezza mtrezza commented Mar 29, 2026

Issue

Session field immutability bypass via falsy-value guard (GHSA-f6j3-w9v3-cq22)

@parse-github-assistant
Copy link
Copy Markdown

parse-github-assistant bot commented Mar 29, 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
Copy Markdown
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
Copy Markdown

coderabbitai bot commented Mar 29, 2026

📝 Walkthrough

Walkthrough

Adds comprehensive test validation for session PUT requests to reject null values for expiresAt, createdWith, installationId, and sessionToken fields. Updates RestWrite session validation logic to check field presence using 'key' in this.data instead of truthy checks, enabling rejection of falsy values.

Changes

Cohort / File(s) Summary
Session validation tests
spec/ParseSession.spec.js
Added four test cases validating that PUT /sessions/:objectId rejects null values for expiresAt, createdWith, installationId, and sessionToken with Parse.Error.INVALID_KEY_NAME. Tests for expiresAt and createdWith also verify stored field values remain unchanged.
Session update validation
src/RestWrite.js
Modified session key validation in handleSession to use presence checks ('key' in this.data) instead of truthy checks, enabling rejection of falsy values (null, empty string, zero) for installationId, sessionToken, expiresAt, and createdWith.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author, leaving required sections like Issue, Approach, and Tasks incomplete as specified in the repository template. Add a comprehensive description following the template: include the security issue being fixed, explain the validation changes made to RestWrite.js and tests added to ParseSession.spec.js, and check applicable task boxes.
✅ 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 accurately describes the main change: fixing a session field immutability bypass vulnerability by validating falsy values, which is reflected in both the test additions (validation of null values) and the code changes (checking for key presence rather than truthy values).

✏️ 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
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.52%. Comparing base (8dd7bf2) to head (9a91fd1).
⚠️ Report is 3 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10347      +/-   ##
==========================================
- Coverage   92.54%   92.52%   -0.02%     
==========================================
  Files         192      192              
  Lines       16538    16538              
  Branches      229      229              
==========================================
- Hits        15305    15302       -3     
- Misses       1213     1216       +3     
  Partials       20       20              

☔ 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-f6j3-w9v3-cq22 v9 fix: Session field immutability bypass via falsy-value guard (GHSA-f6j3-w9v3-cq22) Mar 29, 2026
@mtrezza mtrezza merged commit 9080296 into parse-community:alpha Mar 29, 2026
22 of 24 checks passed
parseplatformorg pushed a commit that referenced this pull request Mar 29, 2026
# [9.7.0-alpha.14](9.7.0-alpha.13...9.7.0-alpha.14) (2026-03-29)

### Bug Fixes

* Session field immutability bypass via falsy-value guard ([GHSA-f6j3-w9v3-cq22](GHSA-f6j3-w9v3-cq22)) ([#10347](#10347)) ([9080296](9080296))
@parseplatformorg
Copy link
Copy Markdown
Contributor

🎉 This change has been released in version 9.7.0-alpha.14

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