You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stored XSS in admin dashboards + active content served on the admin origin via unauthenticated /files/upsert #175
POST /files/upsert is unauthenticated, so stored content must be treated as untrusted user data everywhere it is rendered. Two spots currently allow script execution on the file-server origin — the same origin where the /admin dashboards live:
Stored XSS in admin pages.routes/admin/files/list.ts renders ${file.file_path}, and routes/admin/files/get.ts renders ${file.file_path}, ${file.file_id}, ${file.created_at} unescaped; routes/admin/events/list.ts renders ${event_type} and the JSONified rest payload (which includes the user-supplied initiator and file_path). Writing a file with path /<script>alert(1)</script>/poc.html executes when an admin opens the files list/details pages; <img src=x onerror=...> via initiator executes on the events page.
Active content served on the admin origin./files/static serves stored content with text/html, image/svg+xml, text/javascript (and application/xml), so a file uploaded by anyone becomes a script running on the file-server origin when navigated to directly.
Reproduction
POST /files/upsert
{ "file_path": "/<script>alert(1)</script>/poc.html", "text_content": "x" }
# then open: /admin (File Management) or /admin/files/list → script runs
Proposed fix (small, contained)
escapeHtml() util applied to every user-controlled interpolation in the admin templates (display strings; href attribute values escaped without changing normal-path URLs).
/files/static: X-Content-Type-Options: nosniff on every response; Content-Security-Policy: sandbox on active content types (text/html, text/javascript, image/svg+xml, application/xml), including proxied responses. Bytes/type are unchanged; existing static-route behavior for normal files is preserved.
Tests included with the fix
route-level: admin pages escape a scripted file_path and a scripted initiator; normal file rendering unchanged
route-level: static route returns sandbox CSP + nosniff for .html/.svg/.js, nosniff-only for .txt; bytes unchanged
Activity
9xj89gzrtw-hue commentedon Oct 24, 2026
/attempt #175