Fix parseHash state validation bypass#2788
Open
parasol-aser wants to merge 1 commit intoauth0:masterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2786.
This removes Lock's forwarding of the private
__enableIdPInitiatedLoginauth0-js parseHash option. The private_enableIdPInitiatedLoginand_enableImpersonationconstructor options no longer cause callback parsing to bypass OAuth state validation, so unsolicited token fragments without a matching transaction fail closed through auth0-js.Also updates the public TypeScript declarations so those private state-validation bypass switches are no longer advertised as supported constructor options.
Issue follow-up check
Before opening this PR, I rechecked #2786 through both the GitHub issue page and API. The issue is still open, was last updated at
2026-04-23T05:16:31Z, and the API reportscomments: 0with an empty comments response, so there are no follow-up maintainer notes or scope changes to reflect beyond the original issue body.Changes
_enableIdPInitiatedLogin/_enableImpersonationas a parseHash bypass flag inAuth0APIClient.__enableIdPInitiatedLoginfrom everyclient.parseHash()call while preservinghash,nonce, andstateforwarding._enableImpersonationand_enableIdPInitiatedLoginfromAuth0LockConstructorOptionsand add TypeScript smoke-test expectations that they are rejected.Test plan
npm test -- --runInBand src/__tests__/core/web_api/p2_api.test.jsnpx eslint src/core/web_api/p2_api.js src/__tests__/core/web_api/p2_api.test.jsgit diff --checkrg -n "__enableIdPInitiatedLogin|_enableIdPInitiatedLogin|_enableImpersonation" src types test support