Skip to content

Fix security vulnerabilities: XSS, open redirect, path traversal, IDOR#1176

Merged
bcordis merged 1 commit intodevelopmentfrom
claude/fix-security-issues-uOl4E
Mar 19, 2026
Merged

Fix security vulnerabilities: XSS, open redirect, path traversal, IDOR#1176
bcordis merged 1 commit intodevelopmentfrom
claude/fix-security-issues-uOl4E

Conversation

@bcordis
Copy link
Member

@bcordis bcordis commented Mar 19, 2026

Summary
∙ Reflected XSS in admin cpanel: user-supplied msg query parameter was echoed without escaping
∙ Stored XSS in comment display: comment_text rendered without htmlspecialchars()
∙ XSS in JavaScript context: variables injected into javascript: href without proper encoding in podcast template
∙ Open redirect in 3 controllers: base64-decoded return parameter used in redirects without Uri::isInternal() validation
∙ Path traversal in backup restore: uploaded filename used in path without File::makeSafe() / basename() sanitization
∙ IDOR on media downloads: media files served by ID without checking published status or user access levels
∙ Header injection: Content-Disposition filename not sanitized
∙ Error message XSS: user-supplied handler name concatenated into exception message without escaping
Test plan
∙ All 538 PHPUnit tests pass (0 failures)
∙ PHP syntax check passes (0 errors in 1252 files)
∙ Verify admin cpanel ?msg=<script>alert(1)</script> no longer executes JS
∙ Verify comment text with HTML is displayed escaped
∙ Verify redirect with external base64-encoded URL falls back to internal route
∙ Verify media download returns 403 for unauthorized access levels
∙ Verify backup restore rejects filenames with path traversal characters

- Fix reflected XSS in admin cpanel by escaping user-supplied msg parameter
- Fix stored XSS in comment text output with htmlspecialchars()
- Fix XSS in JavaScript context in podcast template using json_encode()
- Fix open redirect in CwmsermonsController, CwmmediafileController, and
  CwmadminController by validating base64-decoded return URLs with
  Uri::isInternal()
- Fix path traversal in backup restore by sanitizing upload filename with
  File::makeSafe() and basename()
- Fix IDOR in download helper by checking published status and user access
  levels before serving media files
- Sanitize Content-Disposition filename header to prevent header injection
- Escape user-supplied handler name in error messages

https://claude.ai/code/session_01Eq9nzEFGHytEtgTiUgTEHt
@bcordis bcordis merged commit f8a3fc5 into development Mar 19, 2026
6 checks passed
@bcordis bcordis deleted the claude/fix-security-issues-uOl4E branch March 19, 2026 01:52
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