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
Honor CSP sha256 source expressions for inline iframe scripts #864
The exact Code OSS package at WebScene 5b97aac fetches webWorkerExtensionHostIframe.html successfully, but its inline bootstrap never posts vscode.bootstrap.nls. The file declares:
The declared digest exactly matches the 5,588-byte inline script. WebScene's nested-document CSP parser recognizes that a hash source exists and consequently disables unsafe-inline, but frame_script_policy_allows never calculates or compares the script hash. It therefore rejects every hash-authorized inline script. The frame is fetched again after VS Code retries, with the same result, and #81 fails before MessagePort transfer.
Fix
Compute SHA-256 over the exact inline script bytes parsed from the document.
Encode the digest as standard padded Base64 and compare the source expression case-sensitively.
Preserve nonce and external-source behavior; keep unsafe-inline suppressed when any nonce/hash expression is present.
Reject malformed and nonmatching hashes without executing script.
SHA-384/SHA-512 expressions remain fail-closed until matching digest providers are implemented; they must not accidentally enable inline execution.
Native Code OSS-shaped iframe fixture using the exact published digest and the real bootstrap message structure.
Repeat bootstrap/teardown with bounded nodes, wrappers, heap/RSS, task queues, and zero extra idle frames.
Exact packaged Code OSS evidence: one iframe bootstrap, transferred MessagePort, Ready/Initialized handshake, and no application source change.
Performance
Hash each parser-discovered inline script at most once during policy admission. Do not add DOM scans, retained visual nodes, timers, or frame publications.
Activity