Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-2943] Add check for state in handleRedirectCallback #841

Merged
merged 4 commits into from
Nov 18, 2021

Conversation

stevehobbsdev
Copy link
Contributor

Changes

This PR re-adds the check for a matching state value when handling the callback from Auth0. We used to perform this check differently, as the transaction key used to contain the state value (so getting the transaction implictly meant that the state would have to match). However, this check was removed when we removed the state from the transaction key.

As this SDK enforces PKCE which already enables sufficient CSRF protection, this state check is not necessary to perform. However, we do continue to send a state param to the IdP and the specification states that the state must be validated if one is sent to the /authorize endpoint (see sections 4.1.2 and 10.12 of RFC6749).

Rather than remove sending the state value, we've chosen to re-add the check, which should present no issues to customers, but does provide better optics than just removing state.

References

SDK-2943 (internal ticket)

Testing

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language

Checklist

@stevehobbsdev stevehobbsdev added CH: Fixed PR is fixing a bug review:small Small review labels Nov 17, 2021
@stevehobbsdev stevehobbsdev marked this pull request as ready for review November 17, 2021 12:59
@stevehobbsdev stevehobbsdev requested a review from a team as a code owner November 17, 2021 12:59
"cypress": "7.2.0",
"es-check": "^6.0.0",
"es-check": "6.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This being pinned, as there is a potential issue with 6.1.0, have raised it: yowainwright/es-check#139

@stevehobbsdev stevehobbsdev merged commit 5f4d280 into master Nov 18, 2021
@stevehobbsdev stevehobbsdev deleted the sdk-2943/state-check branch November 18, 2021 14:36
@stevehobbsdev stevehobbsdev mentioned this pull request Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed PR is fixing a bug review:small Small review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants