-
Notifications
You must be signed in to change notification settings - Fork 5.2k
OAuth2 filter: improve the csrf token with "Signed Double-Submit Cookie" #37646
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
OAuth2 filter: improve the csrf token with "Signed Double-Submit Cookie" #37646
Conversation
8336232 to
3c03b55
Compare
|
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to |
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
c5eec55 to
485c659
Compare
| @@ -0,0 +1,29 @@ | |||
| diff --git a/single-page-app/verify.sh b/single-page-app/verify.sh | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch is added as a workaround for envoyproxy/examples#384 . It can be removed after envoyproxy/examples#384 is merged.
Commit Message: The current CSRF token in the OAuth2 filter state is a random string. This PR improved it by signing the random string with the HMAC secret, adding protection agains CSRF token forgery.
The new CSRF token is in the format of
<nonce>.<hmac(nonce)>, which is the Signed Double-Submit Cookie pattern recommended by OWASP.Additional Description:
Risk Level: low
Testing: Unit test and integration test
Docs Changes: No
Release Notes: Yes
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #37560]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
cc @denniskniep @missBerg @arkodg