-
Notifications
You must be signed in to change notification settings - Fork 22.8k
CSP sandbox allow-same-origin - clarify #40489
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
base: main
Are you sure you want to change the base?
Conversation
Preview URLs Flaws (3)URL:
|
|
I already fixed the second in another issue. The first outlines a number of problems, the only one that is valid (Origin) is already fixed. I've added "Fixes" above for that. Nothing else to do. |
- : Allows a same-origin sandboxed resource to be treated as same-origin, reducing the restrictions normally applied to a sandbox. | ||
|
||
If this token is not used, the resource is treated as being from a special origin that always fails the {{Glossary("same-origin policy")}} (potentially preventing access to [data storage/cookies](/en-US/docs/Web/Security/Same-origin_policy#cross-origin_data_storage_access) and some JavaScript APIs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tough one to summarize, is this any better?
- : Allows a same-origin sandboxed resource to be treated as same-origin, reducing the restrictions normally applied to a sandbox. | |
If this token is not used, the resource is treated as being from a special origin that always fails the {{Glossary("same-origin policy")}} (potentially preventing access to [data storage/cookies](/en-US/docs/Web/Security/Same-origin_policy#cross-origin_data_storage_access) and some JavaScript APIs). | |
- : Allows a sandboxed resource to maintain its {{Glossary("origin")}}. | |
A sandboxed resource is otherwise treated as being from an origin that always fails {{Glossary("same-origin policy")}} checks, which prevents access to [`localstorage` and `document.cookie`](/en-US/docs/Web/Security/Same-origin_policy#cross-origin_data_storage_access) and some JavaScript APIs. |
causes the content to be treated as being from its real origin instead of forcing it into an opaque origin;
- : Allows a same-origin sandboxed resource to be treated as same-origin, reducing the restrictions normally applied to a sandbox. | ||
|
||
If this token is not used, the resource is treated as being from a special origin that always fails the {{Glossary("same-origin policy")}} (potentially preventing access to [data storage/cookies](/en-US/docs/Web/Security/Same-origin_policy#cross-origin_data_storage_access) and some JavaScript APIs). | ||
The {{httpheader("Origin")}} of such a request would be `null`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The {{httpheader("Origin")}} of such a request would be `null`. | |
The {{httpheader("Origin")}} of sandboxed resources without the `allow-same-origin` keyword is `null`. |
If found the description of the CSP sandbox value
allow-same-origin
to be a little confusing. This rewords to match the pattern of the other values, and adds the note that theOrigin
header will be null if this is not set.This fell out of reviewing #40093
Fixes #40094