Skip to content

Security: No Content Security Policy (CSP) Defined#631

Open
barttran2k wants to merge 1 commit intooffa:masterfrom
barttran2k:contribai/fix/security/no-content-security-policy-csp-defined
Open

Security: No Content Security Policy (CSP) Defined#631
barttran2k wants to merge 1 commit intooffa:masterfrom
barttran2k:contribai/fix/security/no-content-security-policy-csp-defined

Conversation

@barttran2k
Copy link
Copy Markdown
Contributor

Problem

The HTML page loads external scripts and stylesheets from CDNs and fetches content from raw.githubusercontent.com, but no Content-Security-Policy is defined (neither via meta tag nor headers). This makes XSS exploitation easier if any injection vector is found.

Severity: medium
File: index.html

Solution

Add a <meta http-equiv="Content-Security-Policy"> tag restricting script-src, style-src, and connect-src to the specific CDN origins and raw.githubusercontent.com that are needed.

Changes

  • index.html (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The HTML page loads external scripts and stylesheets from CDNs and fetches content from `raw.githubusercontent.com`, but no Content-Security-Policy is defined (neither via meta tag nor headers). This makes XSS exploitation easier if any injection vector is found.

Affected files: index.html

Signed-off-by: Trần Bách <45133811+barttran2k@users.noreply.github.com>
@offa
Copy link
Copy Markdown
Owner

offa commented Apr 7, 2026

Can someone with more experience in web development have a look at this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants