-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Add note on CSP sandbox causing to iframe sandbox section #40468
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
Conversation
Preview URLs Flaws (3)URL:
(comment last updated: 2025-07-21 23:59:05) |
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.
Thanks very much!
- Documents served with the {{HTTPHeader("Content-Security-Policy")}} `sandbox` directive that don't include `allow-same-origin`. | ||
- {{HTMLElement("iframe", "iframes")}} with a sandbox attribute that don't contain the value `allow-same-origin`. |
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.
Shouldn't it be "that doesn't" since "that" refers to the singular "directive"?
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 subject is the iframes - my understanding is that the modifier "with a sandbox attribute" does not change that.
But in honestly, I didn't think about it at all - the other way "feels wrong".
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 iframe doesn't "contain the value"; the attribute "contains the value". It should read "iframes (with a sandbox attribute (that doesn't contain the value))", not "iframes (with a sandbox attribute) (that don't contain the value)" (and in this case the latter should use "and which don't contain the value" anyway)
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.
In English, the iframe contains the attribute so it also contains the allow-same-attribute
. This isn't ambiguous, but I guess our job is to be very pedantic.
- Documents served with the {{HTTPHeader("Content-Security-Policy")}} `sandbox` directive, where the directive value doesn't include `allow-same-origin`.
- {{HTMLElement("iframe", "iframes")}} with a sandbox attribute where the attribute doesn't contain the value `allow-same-origin`.
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.
Description
Added a new bullet point to the list of cases where the
Origin
header may benull
.It covers the scenario where a page is served with a
Content-Security-Policy: sandbox
header without theallow-same-origin
directive.Fixes #40093