Skip to content

Add WebDriver BiDi CSP bypass hooks#12711

Open
juliandescottes wants to merge 1 commit into
whatwg:mainfrom
juliandescottes:csp-bypass
Open

Add WebDriver BiDi CSP bypass hooks#12711
juliandescottes wants to merge 1 commit into
whatwg:mainfrom
juliandescottes:csp-bypass

Conversation

@juliandescottes

@juliandescottes juliandescottes commented Jul 21, 2026

Copy link
Copy Markdown

Adds optional navigable-or-null parameter to "clone a policy container", "create a policy container from a fetch response", and "determine navigation params policy container", and skip populating/copying CSP policies when WebDriver BiDi CSP is bypassed for the given navigable.

Depends on the WebDriver BiDi CSP is bypassed algorithm (https://w3c.github.io/webdriver-bidi/#webdriver-bidi-csp-is-bypassed), merged in w3c/webdriver-bidi#1068

Known gap in the current PR: not trying to handle workers. For dedicated and shared workers, we can retrieve corresponding navigables and call the WebDriver BiDi hook. For service workers, we would need to check whether CSP is bypassed globally. I would like to get feedback first before implementing this.

  • At least two implementers are interested (and none opposed):
    • Google
    • Mozilla
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=2017298
    • WebKit: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs: N/A
  • MDN issue is filed: N/A
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


/acknowledgements.html ( diff )
/browsers.html ( diff )
/browsing-the-web.html ( diff )
/infrastructure.html ( diff )
/semantics.html ( diff )

This PR updates the HTML spec to check whether CSP is bypassed via
WebDriver BiDi configuration for the relevant navigable.

Add an optional navigable-or-null parameter (default null) to "clone a
policy container", "create a policy container from a fetch response", and
"determine navigation params policy container", and skip populating/copying
CSP policies when WebDriver BiDi CSP is bypassed for the given navigable.
Thread the navigable through from "navigate" and "create navigation params
by fetching", the two call sites that have one available. Also guard the
`<meta http-equiv="Content-Security-Policy">` processing steps the same
way, since meta-injected policies bypass the fetch response path entirely.

This depends on the WebDriver BiDi CSP is bypassed algorithm
(https://w3c.github.io/webdriver-bidi/#webdriver-bidi-csp-is-bypassed),
merged in w3c/webdriver-bidi#1068
@juliandescottes

Copy link
Copy Markdown
Author

This is spawned from w3c/webappsec-csp#799 where I wanted to integrate the CSP disabled webdriver BiDi hooks in the CSP specs. The suggestion was to handle that in the HTML spec instead, so I am proposing this PR here.

cc @zcorpan , can you have a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant