Skip to content

fix: Session update endpoint allows overwriting server-generated session fields (GHSA-jc39-686j-wp6q)#10263

Merged
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/GHSA-jc39-686j-wp6q-v9
Mar 21, 2026
Merged

fix: Session update endpoint allows overwriting server-generated session fields (GHSA-jc39-686j-wp6q)#10263
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/GHSA-jc39-686j-wp6q-v9

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Mar 20, 2026

Issue

Session update endpoint allows overwriting server-generated session fields (GHSA-jc39-686j-wp6q)

Tasks

  • Add tests
  • Add changes
  • Add entry to changelog

Incomplete fix of GHSA-5v7g-9h8f-8pgg. The session update path (PUT)
did not block expiresAt or createdWith fields, allowing authenticated
users to bypass server-configured session lifetime policies.
@parse-github-assistant
Copy link

parse-github-assistant bot commented Mar 20, 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
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

coderabbitai bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

These changes add validation to prevent non-admin users from modifying sensitive session fields (expiresAt and createdWith) during session PUT requests. Server-side validation logic is implemented in RestWrite.prototype.handleSession, with corresponding test coverage verifying rejection behavior and master-key override capability.

Changes

Cohort / File(s) Summary
Session Field Validation
src/RestWrite.js
Added validation logic in handleSession to reject expiresAt and createdWith modifications for non-admin session updates, matching existing protection patterns for user, installationId, and sessionToken.
Session Update Tests
spec/ParseSession.spec.js
Added three new tests for PUT /sessions/:sessionId covering: rejection of expiresAt overwrite attempts, rejection of createdWith overwrite attempts, and confirmation that master-key authenticated requests can successfully update expiresAt.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely empty, missing all required template sections including Issue, Approach, and Tasks that are specified in the repository's description template. Complete the pull request description using the provided template, including: a reference to the security issue, description of changes made, and verification that appropriate tasks (tests, security checks) were completed.
✅ 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 clearly and specifically describes the main fix: preventing session update endpoints from overwriting server-generated session fields, with reference to the security advisory identifier.

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

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.14%. Comparing base (a248e8c) to head (6277e9d).
⚠️ Report is 3 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10263      +/-   ##
==========================================
- Coverage   92.54%   92.14%   -0.40%     
==========================================
  Files         192      192              
  Lines       16433    16437       +4     
  Branches      226      226              
==========================================
- Hits        15208    15146      -62     
- Misses       1205     1267      +62     
- Partials       20       24       +4     

☔ 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-jc39-686j-wp6q v9 fix: Session update endpoint allows overwriting server-generated session fields (GHSA-jc39-686j-wp6q) Mar 21, 2026
@mtrezza mtrezza merged commit ea68fc0 into parse-community:alpha Mar 21, 2026
19 of 24 checks passed
parseplatformorg pushed a commit that referenced this pull request Mar 21, 2026
# [9.6.0-alpha.48](9.6.0-alpha.47...9.6.0-alpha.48) (2026-03-21)

### Bug Fixes

* Session update endpoint allows overwriting server-generated session fields ([GHSA-jc39-686j-wp6q](https://github.com/parse-community/parse-server/security/advisories/GHSA-jc39-686j-wp6q)) ([#10263](#10263)) ([ea68fc0](ea68fc0))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 9.6.0-alpha.48

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