fix(apps): close WebRTC/preconnect egress from mini-app views before any third-party view renders

Open
#158 11 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active

Research direction

Start with contracts/app-view/README.md and the desktop escape test referenced by the issue; compare how view and proxy frames behave across WebView2, WKWebView, WebKitGTK, and supported web browsers. The issue requires a design that blocks WebRTC and preconnect egress while preserving host page connections, then passing the escape checks and documenting the enforced policy.

Written by the indexing model from the issue text.

Description

bug

Problem

Mini-app views render inside the shared sandbox proxy (contracts/app-view/). The proxy's content policy stops fetches, subresource loads, frames and navigation, but two channels are not governed by that policy and still reach the network from both the view frame and the proxy frame:

  • WebRTC ICE gathering (RTCPeerConnection with STUN/TURN servers the page chooses)
  • <link rel=preconnect> connections

Browsers do not apply connect-src or default-src to either channel. The result is that a view can contact hosts and ports of its choosing without any request the policy would block, and nothing is visible in the panel.

Verified on Windows (WebView2 158) with the desktop escape test's harness, one loopback sink per frame: the view frame, the proxy frame and the host page all reached their sinks over both channels. The same behaviour is expected on the web host, since it comes from the engine, not from the desktop scheme.

Impact today

Low. Only the bundled first-party sample view renders (demo builds only). This is still the isolation boundary the proxy contract promises for every future view, on web and desktop.

Required before any third-party view renders

Close these channels for view frames, or record an explicit owner decision that accepts them with a bounded policy, before any third-party or untrusted view can render. The apps-isolated and apps-community capabilities stay dark until this issue is closed.

What was checked

  • CSP webrtc 'block': defined in CSP Level 3, not implemented in Chromium or WebKit (unrecognized directives are ignored). The escape test records the WebView2 result.
  • Permissions-Policy and the iframe allow attribute: no feature covers RTCPeerConnection or preconnect.
  • WebView2 browser arguments (WebRTC IP handling, feature switches): they apply to the whole browser process, so they would also change the main window. Not acceptable without a separate decision.
  • Removing the WebRTC constructors with an init script in subframes: only Windows injects init scripts into subframes today, a removal can be undone from another realm, and it does nothing for preconnect.

None of these holds on WebView2, WKWebView and WebKitGTK together, so this needs its own design.

Acceptance criteria

  • On each engine that renders views (WebView2 first; WKWebView and WebKitGTK when views open there; the web host's supported browsers), neither channel reaches a loopback sink from the view or the proxy frame, while a host-page control still does.
  • The desktop escape test's "known gap" checks for WebRTC and preconnect become ordinary passing checks.
  • contracts/app-view/README.md states exactly what the policy enforces.

Related

  • #85, #93 (separate content origin and desktop frames)
  • #133 (shared proxy contract), #134 (desktop scheme and escape test)
Dominant language
No language data
Stars
1
Forks
2
Avg merge
1h 51m
Merged PRs (30d)
103

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextlevelbuilder/dewee-desktop-app

All issues in nextlevelbuilder/dewee-desktop-app

Similar issues

More Desktop Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.