-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[CORS] Old library makes exploitable CORS configuration (need to update dependency) #5745
Comments
|
Ok, so my intuition is correct and fixing all this means:
|
Share App does not need this header. See also: - Potential problem with `Access-Control-Allow-Credentials`: ipfs/kubo#5745 - HTTP Headers Cleanup: ipfs/in-web-browsers#132
This is the default for the gateway but not for the API. However, the gateway doesn't use the CORs library.
go-ipfs should never set the
We don't really use credentials (cookies or otherwise) so this isn't really an issue for us. However, we should still upgrade (and probably shouldn't be allowing credentials when we don't use them). Again note: this only affects the gateway.
Those should have gone in the |
Although... we should be applying the gateway config to the gateway's API. |
Might affect people who have put some middleware that uses credentials in front of the Gateway (?).
By default but potentially affects any user who has modified the API config to set
Yeah: #5909 |
Version information:
master
Type:
Bug
Description:
When
Access-Control-Allow-Origin
is set to*
(think this is the default), the CORS library we use automatically sets it to the value of theOrigin
header of the request. However we also set or recommend to setAccess-Control-Allow-Credentials: true
(not sure why).The result is that this is going around a browser security feature where
Access-Control-Allow-Credentials: true
is not allowed whenAllow-Origin: *
. The library we use for that patched this behaviour and we should upgrade accordingly.More info: https://github.com/rs/cors#allow--with-credentials-security-protection (and linked issues and linked discussions from those issues).
Also, since the go-ipfs APIs have nothing with credentials, cookies etc, I'm not sure why
Access-Control-Allow-Credentials: true
is there (and the documentation invites the user to configure it at least - web UI too). There's probably a reason so I'd love to know (cc. @olizilla, @lidel)Also not clear why
Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
is hardcoded, since probably (?) these headers are not relevant as part of requests made against the API (only responses, that's whyExpose-Headers
is set as well), but I might be wrong.The text was updated successfully, but these errors were encountered: