fix(security): 2 improvements across 2 files#513
Conversation
- Security: Unsafe Content Security Policy with 'unsafe-inline' and 'unsafe-eval' - Security: Unsafe Content Security Policy with 'unsafe-inline' and 'unsafe-eval' Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: Unsafe Content Security Policy with 'unsafe-inline' and 'unsafe-eval' - Security: Unsafe Content Security Policy with 'unsafe-inline' and 'unsafe-eval' Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Reviewed the CSP changes. A couple of notes before merging: feather-icons eval dependency: chooser.html script-src change: The new CSP adds Suggest testing the renderer (both the main window and the crosshair chooser) with these CSP changes before merging. |
Summary
fix(security): 2 improvements across 2 files
Problem
Severity:
High| File:src/renderer/chooser.html:L6The chooser.html file uses a very permissive Content-Security-Policy that allows 'unsafe-inline' for scripts and styles, and 'unsafe-eval' for scripts. This significantly weakens the security benefits of CSP and could allow XSS attacks if any user-controlled data reaches the renderer.
Solution
Remove 'unsafe-inline' and 'unsafe-eval' from the CSP. Use nonce or hash-based CSP for inline scripts. If 'unsafe-eval' is needed for a specific library, consider using a safer alternative or sandboxing that code.
Changes
src/renderer/chooser.html(modified)src/renderer/index.html(modified)