Skip to content

Security: Overly permissive Content Security Policy allows XSS and untrusted script execution#2151

Open
tomaioo wants to merge 1 commit into
cboard-org:masterfrom
tomaioo:fix/security/overly-permissive-content-security-polic
Open

Security: Overly permissive Content Security Policy allows XSS and untrusted script execution#2151
tomaioo wants to merge 1 commit into
cboard-org:masterfrom
tomaioo:fix/security/overly-permissive-content-security-polic

Conversation

@tomaioo

@tomaioo tomaioo commented Apr 15, 2026

Copy link
Copy Markdown

Summary

Security: Overly permissive Content Security Policy allows XSS and untrusted script execution

Problem

Severity: High | File: public/index.html:L7

The CSP in public/index.html is extremely permissive: it allows 'unsafe-inline', 'unsafe-eval', wildcard http://* and https://* in default-src, and broad connect-src/img-src values. This significantly weakens browser-side protections and increases the impact of any HTML/JS injection vulnerability.

Solution

Harden CSP by removing unsafe-inline/unsafe-eval, disallowing wildcard origins, and defining strict directives (script-src, style-src, img-src, connect-src) with explicit trusted domains only. Prefer nonce/hash-based inline script allowances where needed.

Changes

  • public/index.html (modified)

The CSP in `public/index.html` is extremely permissive: it allows `'unsafe-inline'`, `'unsafe-eval'`, wildcard `http://*` and `https://*` in `default-src`, and broad `connect-src`/`img-src` values. This significantly weakens browser-side protections and increases the impact of any HTML/JS injection vulnerability.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant