Skip to content

Fix XSS via mDNS server name injection in launcher#10

Merged
MarvinSchenkel merged 2 commits intomusic-assistant:mainfrom
teancom:fix/xss-mdns-server-name
Feb 18, 2026
Merged

Fix XSS via mDNS server name injection in launcher#10
MarvinSchenkel merged 2 commits intomusic-assistant:mainfrom
teancom:fix/xss-mdns-server-name

Conversation

@teancom
Copy link
Copy Markdown
Contributor

@teancom teancom commented Feb 17, 2026

Replace inline onclick handlers with addEventListener to prevent JavaScript injection through crafted mDNS service names. The escapeHtml() function only escapes HTML element content characters (<, >, &) but not single quotes, which allowed breaking out of the JS string literal in the onclick attribute context.

Adds regression test that verifies user-controlled values are never interpolated into HTML attributes and that click handlers use addEventListener instead of inline onclick.

Replace inline onclick handlers with addEventListener to prevent
JavaScript injection through crafted mDNS service names. The
escapeHtml() function only escapes HTML element content characters
(<, >, &) but not single quotes, which allowed breaking out of
the JS string literal in the onclick attribute context.

Adds regression test that verifies user-controlled values are never
interpolated into HTML attributes and that click handlers use
addEventListener instead of inline onclick.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MarvinSchenkel
Copy link
Copy Markdown

Just some linting issues on the test file. Other than that, another great find, nice fix!

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@teancom
Copy link
Copy Markdown
Contributor Author

teancom commented Feb 17, 2026

Fixed, and added a note for myself to always run prettier (thank you!)

@MarvinSchenkel MarvinSchenkel merged commit fa6fb2b into music-assistant:main Feb 18, 2026
1 check passed
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