-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
Severity: Informational
File: src/web/server.ts:718
Description
reply.header('Content-Security-Policy',
"default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; ..."
);'unsafe-inline' in script-src allows all inline <script> tags and on* event handler attributes. This means any XSS that can inject HTML (such as the case name XSS in #18) can execute JavaScript without CSP blocking it.
Additionally, https://cdn.jsdelivr.net in script-src means the browser trusts any content served from that CDN. A malicious package published to npm (and accessible via a jsdelivr URL) could load attacker-controlled scripts.
Root Cause
The directive is required by the app's extensive use of inline onclick="..." handlers throughout app.js (~17K lines).
Remediation
- Migrate inline
onclick="..."handlers inapp.jstoaddEventListener()calls - Remove
'unsafe-inline'fromscript-src - Consider a nonce-based or hash-based CSP as an intermediate step during migration
- Evaluate whether the jsdelivr.net CDN allowlist is still needed — vendor assets are already self-hosted in
src/web/public/vendor/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels