-
Notifications
You must be signed in to change notification settings - Fork 141
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
Potential vulnerability from returning Origin value as Access-Control-Allow-Origin #364
Comments
Yep, also seeing this issue being pointed out by Snyk just today as a "High" vulnerability. Overview from Snyk is as follows:
Can't really use the package in any production deployments until this is patched. |
From Dependabot:
|
The main difference between setting it to For an API this is irrelevant, because you typically do not have anything stateful. It's more dangerous if you just enable CORS on a regular website, because then one could impersonate the user who's currently logged-in by sending CORS requests that inherit their session. |
The |
Thanks y'all. Yes, the behavior for Access-Control-Allow-Private-Header has been adjusted in versions 4.0.2 and 5.0.0 to be secure by default. Fundamentally it is up to users to choose and configure how they would like to return CORS headers. I'm open to proposed changes to the strategy #320 (comment) |
It appears that flask-cors (by default?) sets the response
Access-Control-Allow-Origin
to the value of the request'sOrigin
. I understand from https://fetch.spec.whatwg.org/#http-access-control-allow-origin that this is typical, however pentesting resources like https://blog.vidocsecurity.com/blog/cross-origin-resource-sharing-vulnerabilities/ indicate that "Dynamically reflecting origins from requests could be easily exploitable by a malicious actor."I confess I don't fully understand the semantics of this header, nor the potential ramifications of a malicious actor exploiting the
Origin
header, but this behavior has been pointed out to me as a security vulnerability and so I'm trying to evaluate how or if it can be mitigated within flask-cors.Thanks for the help, and apologies if this has already been discussed elsewhere, I did search the repo's issues but didn't see any obviously-related issues.
The text was updated successfully, but these errors were encountered: