Skip to content

feat(container): gate WebRTC on a decision resolved before the product realm - #444

Open
filvecchiato wants to merge 6 commits into
mainfrom
feat/gate-webrtc-egress
Open

feat(container): gate WebRTC on a decision resolved before the product realm#444
filvecchiato wants to merge 6 commits into
mainfrom
feat/gate-webrtc-egress

Conversation

@filvecchiato

Copy link
Copy Markdown
Collaborator

Restores enforcement for RemotePermission::WebRtc, which #399 left advertised but unenforced. ICE reaches an arbitrary host over UDP, so no rule list, shouldInterceptRequest, or CSP directive sees it — this is the one egress path with no out-of-realm enforcement point.

  • The host peeks the decision and bakes it in as a literal; the container removes RTCPeerConnection unless it is an explicit true. An async request from inside the product realm is forgeable (WebRTC gating #379), and removing the constructor leaves no reachable prototype to escape from. A fresh grant applies on the next load.
  • Hosts must now inject the container into every frame (forMainFrameOnly: false). A subframe had no container at all, so innerHTML/document.write/srcdoc reached a realm with pristine fetch/WebSocket/RTCPeerConnection. The bootstrap stays main-frame-only, so subframes fail closed.
  • 18 tests cover all four WebRTC gating #379 escapes, plus two that prove those routes do defeat a subclass gate so the suite cannot pass vacuously.

…t realm

An async permission request inside the product's own realm is forgeable, so the host bakes the decision in as a literal and a fresh grant only applies on the next load.
@filvecchiato
filvecchiato requested a review from a team August 18, 2026 14:11
Comment thread ios/truapi-host/README.md Outdated
…very frame

A main-frame-only container leaves any subframe with pristine fetch/WebSocket/RTCPeerConnection, and a product reaches one through an iframe in its own HTML, so the frame scope has to be API rather than documentation.
Comment thread js/container/src/webrtc.ts
Comment thread js/container/src/freeze.ts
Comment thread android/truapi-host/src/main/kotlin/io/parity/truapi/TrUAPIHost.kt
Comment thread android/truapi-host/src/main/kotlin/io/parity/truapi/TrUAPIHost.kt
@filvecchiato
filvecchiato enabled auto-merge August 19, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants