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

CSRF header should not be sent to cross domain sites #1469

Closed
sebastien-helbert opened this issue Jan 26, 2022 · 3 comments
Closed

CSRF header should not be sent to cross domain sites #1469

sebastien-helbert opened this issue Jan 26, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@sebastien-helbert
Copy link

Describe the bug

When CSRF is enabled a CSRF token is sent for each issued request including to cross domain sites.

This is a problem when the third party server does not allow this header to be sent (This use case is well described in #1036)
and this potentially may be exploited by an attacker as it can allow a third party site to obtain a token from the main site and therefore forge a CSRF request.

To Reproduce

This can be reproduced easily with a password OAuth flow security scheme and a keycloak server (which by default does not authorize the x-xsrf-token header to be sent because it is not expected). See #1036

Expected behavior
The CSRF header should not be added for cross domain sites

@bnasslahsen
Copy link
Contributor

@sebastien-helbert ,

Do not create duplicates. #1228

@bnasslahsen bnasslahsen added the duplicate This issue or pull request already exists label Jan 26, 2022
sebastien-helbert pushed a commit to sebastien-helbert/springdoc-openapi that referenced this issue Jan 26, 2022
@sebastien-helbert
Copy link
Author

@sebastien-helbert ,

Do not create duplicates. #1228

this is not a duplicate

@bnasslahsen bnasslahsen added enhancement New feature or request and removed duplicate This issue or pull request already exists labels Jan 26, 2022
@bnasslahsen
Copy link
Contributor

@sebastien-helbert ,
Do not create duplicates. #1228

this is not a duplicate

Ok 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants