From d154dce4f7504d4b224fd439af03ebbccf69cbc2 Mon Sep 17 00:00:00 2001
From: ntbang0901 <121003585+ntbang0901@users.noreply.github.com>
Date: Sat, 21 Nov 2026 19:49:42 +0530
Subject: [PATCH] fix(app): restrict base and form targets in the workbench CSP
(#4874)
The workbench CSP had no base-uri or form-action, so injected markup could add a element to retarget relative URLs or post a form to any origin. Add base-uri 'self' and form-action 'none'; the workbench never uses and every form handles submit in script. The plugin view CSP already sets form-action 'none'.
Co-authored-by: ntbang0901 <121003585+ntbang0901@users.noreply.github.com>
---
src-tauri/tauri.conf.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 25096a8a1..a3afb0543 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -26,7 +26,7 @@
}
],
"security": {
- "csp": "default-src 'self'; img-src 'self' asset: data: blob: http: https:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src ipc: http://ipc.localhost; script-src 'self' 'wasm-unsafe-eval'; worker-src 'self' blob:; frame-src http://127.0.0.1:* openidea-plugin: http://openidea-plugin.localhost; frame-ancestors 'none'"
+ "csp": "default-src 'self'; img-src 'self' asset: data: blob: http: https:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src ipc: http://ipc.localhost; script-src 'self' 'wasm-unsafe-eval'; worker-src 'self' blob:; frame-src http://127.0.0.1:* openidea-plugin: http://openidea-plugin.localhost; frame-ancestors 'none'; base-uri 'self'; form-action 'none'"
}
},
"bundle": {