You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security: iframe sandbox allows both allow-scripts and allow-same-origin in WASM fallback path #376
When c is falsy (WASM fallback path — Safari Lockdown Mode, restrictive CSP), the iframe receives both allow-scripts and allow-same-origin.
Why this is a problem
The HTML spec explicitly warns that combining allow-scripts and allow-same-origin on a same-origin iframe allows the embedded document to remove its own sandbox attribute via JavaScript, escaping the sandbox entirely:
"Setting both the allow-scripts and allow-same-origin keywords together when the embedded page has the same origin as the embedding page allows the embedded page to simply remove the sandbox attribute."
Impact
If an attacker can control content injected into the sandboxed iframe (e.g. via the srcdoc attribute construction or a XSS elsewhere), the sandbox provides no isolation.
The allow-scripts-only path (when c is truthy) is safe.
Suggested fix
Remove allow-same-origin from the fallback path, or serve the iframe content from a data URI / separate origin so allow-same-origin is a no-op.
Activity