Skip to content

Fix XSS in browse source file tree#23

Merged
andrew merged 1 commit into
mainfrom
fix-browse-xss
Mar 13, 2026
Merged

Fix XSS in browse source file tree#23
andrew merged 1 commit into
mainfrom
fix-browse-xss

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented Mar 12, 2026

File paths from archive contents were interpolated directly into onclick handlers and innerHTML via JS template literals. A crafted filename containing quotes could break out of the string context and execute arbitrary JavaScript.

Adds an escapeHTML helper that sanitizes quotes, angle brackets, and ampersands, and applies it to every interpolated path/URL value in the browse source page.

File paths from archive contents were interpolated directly into onclick
handlers and innerHTML via template literals. A crafted filename containing
quotes could break out of the string context and execute arbitrary JS.

Add an escapeHTML helper and use it on all interpolated path and URL values
in the browse source page.
@andrew andrew merged commit 38213d9 into main Mar 13, 2026
5 checks passed
@andrew andrew deleted the fix-browse-xss branch March 13, 2026 07:26
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.

1 participant