Skip to content

fix: Auth provider validation bypass on login via partial authData (GHSA-pfj7-wv7c-22pr)#10246

Merged
mtrezza merged 2 commits intoparse-community:alphafrom
mtrezza:fix/GHSA-pfj7-wv7c-22pr-v9
Mar 19, 2026
Merged

fix: Auth provider validation bypass on login via partial authData (GHSA-pfj7-wv7c-22pr)#10246
mtrezza merged 2 commits intoparse-community:alphafrom
mtrezza:fix/GHSA-pfj7-wv7c-22pr-v9

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Mar 19, 2026

Issue

Auth provider validation bypass on login via partial authData (GHSA-pfj7-wv7c-22pr)

@parse-github-assistant
Copy link

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

parseplatformorg commented Mar 19, 2026

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 19, 2026

📝 Walkthrough

Walkthrough

Deprecates the allowExpiredAuthDataToken option and changes auth handling so provider validation always runs on login by modifying the auth-data validation condition in RestWrite.

Changes

Cohort / File(s) Summary
Deprecation docs & registry
DEPRECATIONS.md, src/Deprecator/Deprecations.js
Added deprecation entry (DEPPS20) for allowExpiredAuthDataToken and registered a deprecation descriptor instructing removal or disabling.
Option metadata & docs
src/Options/Definitions.js, src/Options/docs.js, src/Options/index.js
Marked allowExpiredAuthDataToken as deprecated and updated help/JSDoc describing new semantics: providers always validated on login; update re-validation depends on option value.
Auth validation logic
src/RestWrite.js
Changed handleAuthData condition to include isLogin, ensuring auth provider validation always runs on login (`if (isLogin
Tests (security)
spec/vulnerabilities.spec.js
Added GHSA-focused tests verifying validateAuthData is called on login (including when incoming authData is a subset), preventing account takeover, and that update behavior differs under the deprecated option.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant Server as RestWrite
  participant Auth as Auth.handleAuthDataValidation
  participant Adapter as AuthAdapter.validateAuthData
  participant DB as User/Database

  Client->>Server: POST /login (authData)
  Server->>Auth: validateAuthData(authData)  %% rgba(100,149,237,0.5)
  Auth->>Adapter: validateAuthData(provider, authData)  %% rgba(60,179,113,0.5)
  Adapter-->>Auth: validation result
  Auth-->>Server: validation outcome
  alt valid
    Server->>DB: findOrCreate/update user
    DB-->>Server: user record
    Server-->>Client: 200 OK + session
  else invalid
    Server-->>Client: 400/401 error
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 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. The required template with sections for Issue, Approach, and Tasks is completely empty. Add a pull request description following the template, including: the security issue being addressed, the approach/changes made, and confirmation of completed tasks (tests added, documentation updated, security check added).
✅ 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 pull request title clearly and concisely describes the main security fix: preventing an auth provider validation bypass on login when partial authData is submitted, with the CVE identifier (GHSA-pfj7-wv7c-22pr) for clarity.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@src/Deprecator/Deprecations.js`:
- Around line 79-83: The option metadata for allowExpiredAuthDataToken is
missing the deprecation notice in its help text; open the option definition for
allowExpiredAuthDataToken in Options/index.js and append the runtime deprecation
message used in Deprecator/Deprecations.js ("This option has a limited effect
since auth providers are now always validated on login...") following the same
format used by enableInsecureAuthAdapters and mountPlayground, then run npm run
definitions to regenerate src/Options/Definitions.js and src/Options/docs.js so
the docs and definitions include the deprecation text.
🪄 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: 0b8e7520-a594-4c6a-b5a7-e180f1ff922b

📥 Commits

Reviewing files that changed from the base of the PR and between 859aa65 and 146c5d5.

📒 Files selected for processing (4)
  • DEPRECATIONS.md
  • spec/vulnerabilities.spec.js
  • src/Deprecator/Deprecations.js
  • src/RestWrite.js

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10246   +/-   ##
=======================================
  Coverage   92.60%   92.60%           
=======================================
  Files         192      192           
  Lines       16358    16358           
  Branches      201      201           
=======================================
  Hits        15148    15148           
  Misses       1193     1193           
  Partials       17       17           

☔ 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-pfj7-wv7c-22pr v9 fix: Auth provider validation bypass on login via partial authData (GHSA-pfj7-wv7c-22pr) Mar 19, 2026
@mtrezza mtrezza merged commit 98f4ba5 into parse-community:alpha Mar 19, 2026
21 of 24 checks passed
parseplatformorg pushed a commit that referenced this pull request Mar 19, 2026
# [9.6.0-alpha.41](9.6.0-alpha.40...9.6.0-alpha.41) (2026-03-19)

### Bug Fixes

* Auth provider validation bypass on login via partial authData ([GHSA-pfj7-wv7c-22pr](GHSA-pfj7-wv7c-22pr)) ([#10246](#10246)) ([98f4ba5](98f4ba5))
@parseplatformorg
Copy link
Contributor

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

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