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

Fix #16193 to not reflect origin header for wildcard origins #16198

Merged
merged 5 commits into from
May 1, 2018
Merged

Fix #16193 to not reflect origin header for wildcard origins #16198

merged 5 commits into from
May 1, 2018

Conversation

chenjj
Copy link
Contributor

@chenjj chenjj commented Apr 30, 2018

Q A
Is bugfix? yes
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues fix #16193

@samdark samdark added this to the 2.0.16 milestone Apr 30, 2018
@SilverFire SilverFire merged commit 3317d26 into yiisoft:master May 1, 2018
// Per CORS standard (https://fetch.spec.whatwg.org), wildcard origins shouldn't be used together with credentials
if (isset($this->cors['Access-Control-Allow-Credentials']) && $this->cors['Access-Control-Allow-Credentials']) {
if (YII_DEBUG) {
throw new Exception("Allowing credentials for wildcard origins is insecure. Please specify more restrictive origins or set 'credentials' to false in your CORS configuration.");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe \ before Exception?

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

Successfully merging this pull request may close these issues.

CORS security: reflecting any origin header value when configured to * is dangerous
4 participants