Skip to content

Security: Content Security Policy allows unsafe-eval#282

Open
tomaioo wants to merge 1 commit into
nextcloud:mainfrom
tomaioo:fix/security/content-security-policy-allows-unsafe-ev
Open

Security: Content Security Policy allows unsafe-eval#282
tomaioo wants to merge 1 commit into
nextcloud:mainfrom
tomaioo:fix/security/content-security-policy-allows-unsafe-ev

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 13, 2026

Summary

Security: Content Security Policy allows unsafe-eval

Problem

Severity: Critical | File: lib/Controller/DisplayController.php:L54

In lib/Controller/DisplayController.php, the ContentSecurityPolicy allows 'unsafe-eval' script domain. This severely weakens CSP protection and allows inline JavaScript execution, making the application vulnerable to XSS attacks.

Solution

Remove the line '$policy->addAllowedScriptDomain(''unsafe-eval'');' or replace with specific allowed script sources. If inline scripts are needed, use nonces instead.

Changes

  • lib/Controller/DisplayController.php (modified)

In lib/Controller/DisplayController.php, the ContentSecurityPolicy allows 'unsafe-eval' script domain. This severely weakens CSP protection and allows inline JavaScript execution, making the application vulnerable to XSS attacks.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@AndyScherzinger
Copy link
Copy Markdown
Member

for ref: #265

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.

2 participants