← All tests

De-AMP CSP Sandbox Bypass Test

Site A: test-website-a.pages.dev

What this tests

A page served with Content-Security-Policy: sandbox (no allow-* flags) is forbidden from navigating the top-level frame. A <meta http-equiv="refresh"> on such a page is refused.

Brave's De-AMP feature sniffs every text/html response for AMP markup plus a <link rel="canonical"> and redirects the top frame to that canonical URL. It does not inspect the response's CSP header, so a sandboxed page still gets navigated to its (attacker-controlled) canonical URL, bypassing the sandbox restriction.

Steps

  1. Enable brave://settings/privacy → "Auto-redirect AMP pages" (on by default).
  2. Open the sandboxed AMP page link below. If De-AMP ignores CSP you are redirected to /de-amp/csp-sandbox/landed.html. That is the bug.
  3. Open the sandboxed meta-refresh control. You should stay put; the console shows the refresh was refused because the document is sandboxed. This confirms the header is otherwise honored.
  4. Open the sandboxed AMP page in Chrome (no De-AMP). You should stay put, confirming De-AMP is the cause.

Test Links

1. Sandboxed AMP page (CSP: sandbox) -- De-AMP should NOT redirect, but does

2. Sandboxed meta-refresh (control) -- sandbox correctly blocks navigation

3. AMP page, no CSP (control) -- ordinary, expected De-AMP redirect

Expected results

Link Protected browser Vulnerable (current Brave)
1. Sandboxed AMP page Stays on page Redirected to landed.html
2. Sandboxed meta-refresh Stays on page (refused) Stays on page (refused)
3. AMP page, no CSP Redirected (expected) Redirected (expected)