Skip to content

Fix js/xss-through-dom: whitelist slug chars in TP destination URLs - #4

Merged
clouths merged 1 commit into
mainfrom
fix-codeql-xss
Oct 5, 2026
Merged

clouths merged 1 commit into
mainfrom
fix-codeql-xss

Conversation

@clouths

@clouths clouths commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Fixes CodeQL alert #1: DOM text from data-dests flows into window.location.href via hrefOf() without sanitization.

The fix strips any character not in [a-z0-9-] so a tampered value can never produce a non-zone path or a scheme switch.

Adds a Playwright test: opens a multi-dest TP selector, clicks a destination, asserts the navigated URL matches /zones//.

CodeQL alert #1: DOM text from data-dests flows into window.location.href
via hrefOf() without sanitization. The fix strips any character not in
[a-z0-9-] so a tampered value can never produce a non-zone path or a
scheme switch (e.g. javascript:).

Adds a Playwright test that opens a multi-dest TP selector, clicks a
destination, and asserts the navigated URL matches /zones/<safe-slug>/.
@clouths clouths self-assigned this Oct 5, 2026
@clouths
clouths merged commit 1c6b938 into main Oct 5, 2026
7 of 13 checks passed
@clouths
clouths deleted the fix-codeql-xss branch October 5, 2026 23:28
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