Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: Endpoint /loginAs allows readOnlyMasterKey to gain full read and write access as any user (GHSA-79wj-8rqv-jvp5) - #10098

#10098
Merged
mtrezza merged 1 commit into
parse-community:alphaparse-community/parse-server:alphafrom
mtrezza:fix/jvp5-9mtrezza/parse-server:fix/jvp5-9Copy head branch name to clipboard
Mar 5, 2026
Merged

fix: Endpoint /loginAs allows readOnlyMasterKey to gain full read and write access as any user (GHSA-79wj-8rqv-jvp5)#10098
mtrezza merged 1 commit into
parse-community:alphaparse-community/parse-server:alphafrom
mtrezza:fix/jvp5-9mtrezza/parse-server:fix/jvp5-9Copy head branch name to clipboard

Conversation

@mtrezza

@mtrezza mtrezza commented Mar 5, 2026

Copy link
Copy Markdown
Member

Pull Request

Issue

Endpoint /loginAs allows readOnlyMasterKey to gain full read and write access as any user (GHSA-79wj-8rqv-jvp5)

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK

Summary by CodeRabbit

  • Bug Fixes

    • Added validation to prevent login-as operations when using a read-only master key, now returns a permission denied error.
  • Tests

    • Added test coverage for read-only master key rejection in login-as operations.

@parse-github-assistant

Copy link
Copy Markdown

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant Bot changed the title fix: jvp5-9 fix: Jvp5-9 Mar 5, 2026
@parse-github-assistant

parse-github-assistant Bot commented Mar 5, 2026

Copy link
Copy Markdown

🚀 Thanks for opening this pull request!

@parseplatformorg

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scanner 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

coderabbitai Bot commented Mar 5, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR adds validation to prevent login-as operations when using a read-only master key. It includes a security check in the UsersRouter that throws an OPERATION_FORBIDDEN error if the master key is read-only, with corresponding test case coverage.

Changes

Cohort / File(s) Summary
Read-Only Master Key Validation for Login-As
src/Routers/UsersRouter.js, spec/rest.spec.js
Adds an OPERATION_FORBIDDEN check in handleLogInAs to block login-as operations when using a read-only master key, with test case verifying rejection and error message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is mostly complete with issue reference (security advisory), but the 'Approach' section is missing details and the 'Closes:' field still shows 'FILL_THIS_OUT' instead of an actual issue number. Replace 'FILL_THIS_OUT' with the actual GitHub issue number and provide detailed description of the approach/changes made to fix the vulnerability.
✅ 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 describes the security fix, specifically addressing the loginAs endpoint vulnerability with read-only master keys (GHSA-79wj-8rqv-jvp5).

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@mtrezza mtrezza changed the title fix: Jvp5-9 fix: Endpoint /loginAs allows readOnlyMasterKey to gain full read and write access as any user (GHSA-79wj-8rqv-jvp5) Mar 5, 2026
@codecov

codecov Bot commented Mar 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.65%. Comparing base (036365a) to head (b522499).
⚠️ Report is 28 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10098   +/-   ##
=======================================
  Coverage   92.65%   92.65%           
=======================================
  Files         191      191           
  Lines       15841    15843    +2     
  Branches      180      180           
=======================================
+ Hits        14677    14679    +2     
  Misses       1152     1152           
  Partials       12       12           

☔ 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 merged commit bc20945 into parse-community:alpha Mar 5, 2026
24 checks passed
@mtrezza
mtrezza deleted the fix/jvp5-9 branch March 5, 2026 02:29
parseplatformorg pushed a commit that referenced this pull request Mar 5, 2026
# [9.5.0-alpha.4](9.5.0-alpha.3...9.5.0-alpha.4) (2026-03-05)

### Bug Fixes

* Endpoint `/loginAs` allows `readOnlyMasterKey` to gain full read and write access as any user ([GHSA-79wj-8rqv-jvp5](GHSA-79wj-8rqv-jvp5)) ([#10098](#10098)) ([bc20945](bc20945))
@parseplatformorg

Copy link
Copy Markdown
Contributor

🎉 This change has been released in version 9.5.0-alpha.4

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Mar 5, 2026
parseplatformorg pushed a commit that referenced this pull request Mar 7, 2026
# [9.5.0](9.4.1...9.5.0) (2026-03-07)

### Bug Fixes

* `PagesRouter` path traversal allows reading files outside configured pages directory ([GHSA-hm3f-q6rw-m6wh](GHSA-hm3f-q6rw-m6wh)) ([#10104](#10104)) ([e772543](e772543))
* Endpoint `/loginAs` allows `readOnlyMasterKey` to gain full read and write access as any user ([GHSA-79wj-8rqv-jvp5](GHSA-79wj-8rqv-jvp5)) ([#10098](#10098)) ([bc20945](bc20945))
* File creation and deletion bypasses `readOnlyMasterKey` write restriction ([GHSA-xfh7-phr7-gr2x](GHSA-xfh7-phr7-gr2x)) ([#10095](#10095)) ([036365a](036365a))
* File metadata endpoint bypasses `beforeFind` / `afterFind` trigger authorization ([GHSA-hwx8-q9cg-mqmc](GHSA-hwx8-q9cg-mqmc)) ([#10106](#10106)) ([72e7707](72e7707))
* GraphQL `__type` introspection bypass via inline fragments when public introspection is disabled ([GHSA-q5q9-2rhp-33qw](GHSA-q5q9-2rhp-33qw)) ([#10111](#10111)) ([61261a5](61261a5))
* JWT audience validation bypass in Google, Apple, and Facebook authentication adapters ([GHSA-x6fw-778m-wr9v](GHSA-x6fw-778m-wr9v)) ([#10113](#10113)) ([9f8d3f3](9f8d3f3))
* Malformed `$regex` query leaks database error details in API response ([GHSA-9cp7-3q5w-j92g](GHSA-9cp7-3q5w-j92g)) ([#10101](#10101)) ([9792d24](9792d24))
* Regular Expression Denial of Service (ReDoS) via `$regex` query in LiveQuery ([GHSA-mf3j-86qx-cq5j](GHSA-mf3j-86qx-cq5j)) ([#10118](#10118)) ([5e113c2](5e113c2))

### Features

* Add `Parse.File` option `maxUploadSize` to override the Parse Server option `maxUploadSize` per file upload ([#10093](#10093)) ([3d8807b](3d8807b))
* Add security check for server option `mountPlayground` for GraphQL development ([#10103](#10103)) ([2ae5db1](2ae5db1))
* Add server option `readOnlyMasterKeyIps` to restrict `readOnlyMasterKey` by IP ([#10115](#10115)) ([cbff6b4](cbff6b4))
* Add support for `Parse.File.setDirectory`, `setMetadata`, `setTags` with stream-based file upload ([#10092](#10092)) ([ca666b0](ca666b0))
* Allow to identify `readOnlyMasterKey` invocation of Cloud Function via `request.isReadOnly` ([#10100](#10100)) ([2c48751](2c48751))
* Deprecate GraphQL Playground that exposes master key in HTTP response  ([#10112](#10112)) ([d54d800](d54d800))
@parseplatformorg

Copy link
Copy Markdown
Contributor

🎉 This change has been released in version 9.5.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released Released as stable version state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.