-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue #3129] Validate that the nonce matches in login gov token resp…
…onse (#3211) ## Summary Fixes #3129 ### Time to review: __10 mins__ ## Changes proposed Validate the nonce value when receiving the token back from login.gov Delete the login gov state value after we've used it once Some restructuring to handle the multi-commit approach required here ## Context for reviewers We delete the state object after processing a response that uses it to prevent any sort of replay attack (ie. that state should be used for a single session of logging in, it shouldn't ever be used again). If a user navigates to the login page again later, we'd make a new state anyways, so the data isn't needed anyways. As for the nonce, this is a UUID we generated when we first redirected someone to login.gov - login.gov doesn't echo it back to us until we are parsing the response from the token endpoint. In short, by checking for this, we protect ourselves from replay attacks. ## Additional information See: https://openid.net/specs/openid-connect-core-1_0.html#NonceNotes for more details on the nonce https://en.wikipedia.org/wiki/Replay_attack
- Loading branch information
Showing
5 changed files
with
136 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.