-
-
Notifications
You must be signed in to change notification settings - Fork 308
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 header Origin allowing any domain #217
Comments
I'd happily accept a PR that disables CORS completely or allows restricting the value. |
@brycekahle I'll have something for you to review early next week. Thanks. |
@brycekahle Do you know if the I don't see any integration tests, other than the sample |
Looks like it is ignored: https://github.com/sockjs/sockjs-protocol/blob/8816e93c695d92d6a16f744a6a8a08f22df64d7e/sockjs-protocol.py#L278 The tests are in the sockjs-protocol repo. |
@brycekahle I've run the tests in the sockjs-protocol repo against the changes I made in PR #218. All of the tests pass with the default configuration (in |
Fixed in #218 |
Thanks for allowing us to disable CORS. It works beautifully. Currently, we only have 2 options: enable CORS to all origins or disable it. I must enable CORS and limit it to a set of origins (URLs). Would you still happily accept a PR for this addition? I know the statement above was made 7 years ago hence asking. I'd be happy to make a PR to limit CORS to a set of origins. |
I would like to know more about the implementation and implication of that approach, care to share more? or you can come with a draft proof of concept PR |
During a recent security scan of our production environment a potential CORS vulnerability was raised. It seems that sockjs automatically sets the
Access-Control-Allow-Origin
header to whatever the requesting domain is, if any sockjs path is referenced from another domain.For example, if I request the URL
https://www.meteor.com/sockjs/info
from a jsfiddle script, theAccess-Control-Allow-Origin
value is set tohttps://fiddle.jshell.net
, by sockjs.After looking at your source code, I noticed a hard coded reference where the requesting
origin
header is being used to set the responseAccess-Control-Allow-Origin
header :https://github.com/sockjs/sockjs-node/blob/master/src/trans-xhr.coffee#L63
For security purposes our application should not allow cross origin access to any paths. Would it be possible to add an option to disable this default behavior, or even the option to disable CORS completely, for the sockjs paths?
The text was updated successfully, but these errors were encountered: