Security: Renderer page lacks a strict Content Security Policy (CSP)#210
Conversation
The renderer HTML does not define a Content-Security-Policy. In an Electron app, missing CSP significantly increases the impact of any XSS/injection bug, potentially enabling arbitrary script execution in the renderer and abuse of preload-exposed IPC APIs. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
|
@claude would this change cause some functionalities to not work? like extensions or third party integrations |
|
I'll analyze this and get back to you. |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
19 similar comments
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |
|
Good question—yes, a stricter CSP can break features that rely on inline scripts/styles, |

Summary
Security: Renderer page lacks a strict Content Security Policy (CSP)
Problem
Severity:
High| File:src/renderer/index.html:L1The renderer HTML does not define a Content-Security-Policy. In an Electron app, missing CSP significantly increases the impact of any XSS/injection bug, potentially enabling arbitrary script execution in the renderer and abuse of preload-exposed IPC APIs.
Solution
Add a restrictive CSP (prefer HTTP header; meta as fallback), remove unsafe-inline where possible, and move inline scripts to external files with nonces/hashes. Example baseline: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; connect-src 'self' https:; object-src 'none'; base-uri 'none'; frame-ancestors 'none'.
Changes
src/renderer/index.html(modified)