From e9b2ef3258bbe0dec52860822fce27856b6f55f2 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 14 Oct 2026 06:19:12 +0200 Subject: [PATCH] fix: let plugin frames use forms without letting them post anywhere --- lib/__tests__/plugin-sandbox-route-gate.test.ts | 2 ++ lib/plugin-sandbox/host-bridge.ts | 4 +++- proxy.ts | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/__tests__/plugin-sandbox-route-gate.test.ts b/lib/__tests__/plugin-sandbox-route-gate.test.ts index 6032ca8e0..4da191ba2 100644 --- a/lib/__tests__/plugin-sandbox-route-gate.test.ts +++ b/lib/__tests__/plugin-sandbox-route-gate.test.ts @@ -113,6 +113,8 @@ describe('plugin sandbox routes (GHSA-96cx-gx36-3g79)', () => { } // The router refetches the sandbox page itself, so its own origin stays. expect(directives['connect-src']).toEqual(["'self'"]); + // Plugin frames may use forms (allow-forms) but not post them anywhere. + expect(directives['form-action']).toEqual(["'none'"]); }); it('keeps https images and connections for the mail UI itself', async () => { diff --git a/lib/plugin-sandbox/host-bridge.ts b/lib/plugin-sandbox/host-bridge.ts index 6bd6704be..315d89652 100644 --- a/lib/plugin-sandbox/host-bridge.ts +++ b/lib/plugin-sandbox/host-bridge.ts @@ -161,7 +161,9 @@ export class SandboxInstance { // `sandbox-ready` would never post). const sandboxFlags = this.privileged || process.env.NODE_ENV === 'development' ? 'allow-scripts allow-same-origin' - : 'allow-scripts'; + // allow-forms: plugin UIs can use