Skip to content

fix(assessment): escape citation URLs in GA appendix wikitext#156

Open
tieguy wants to merge 1 commit into
mainfrom
fix-ga-appendix-url-escaping
Open

fix(assessment): escape citation URLs in GA appendix wikitext#156
tieguy wants to merge 1 commit into
mainfrom
fix-ga-appendix-url-escaping

Conversation

@tieguy

@tieguy tieguy commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

url::Url leaves ] } { unencoded in query/fragment, so a citation URL like https://x?y=]{{Delete}} breaks out of [url] syntax into a live template in the rendered GA appendix.

Adds escape_wikitext_url() and routes all URL emissions through it.

Impact: attacker-controlled citation text in an article can reach a human's clipboard as live wikitext when the GA appendix is pasted back into a page.

🤖 Generated with Claude Code

@tieguy
tieguy requested a review from schiste as a code owner July 14, 2026 16:53
A citation url=/archive-url= comes straight from article wikitext via
url::Url::parse, and the url crate leaves ] { } unencoded in a query or
fragment. Emitted raw into the appendix's [url …] external-link syntax, a
source URL like https://example.test/x?y=]{{Delete}} closed the link early
and turned the trailing {{Delete}} into a live template transclusion in the
wikitext an editor pastes onto a GA review page — article-sourced wikitext
injection. Every URL emission now routes through escape_wikitext_url, which
percent-encodes the external-link-hostile characters (keeping the link live,
unlike escape_verbatim's <nowiki> wrapper). Other verbatim fields already
went through escape_verbatim; URLs were the lone unescaped one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tieguy
tieguy force-pushed the fix-ga-appendix-url-escaping branch from 12d388b to 3d34662 Compare July 16, 2026 19:44
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