Skip to content

Fix XSS in Welcome template and sanitize Reviewed in User review #set#2

Open
tosfos wants to merge 1 commit intomasterfrom
fix-review-accounts-xss-and-set-sanitization
Open

Fix XSS in Welcome template and sanitize Reviewed in User review #set#2
tosfos wants to merge 1 commit intomasterfrom
fix-review-accounts-xss-and-set-sanitization

Conversation

@tosfos
Copy link

@tosfos tosfos commented Feb 15, 2026

Summary

Addresses two security issues found during repo audit:

  1. XSS in Welcome templateTemplate/Welcome.mediawiki outputs {{{name}}} raw in "Hello {{{name}}}". When the welcome message is posted to a new user's talk page, the name is the username; a username containing <script> or similar would execute. The same parameter is used in formredlink target=User:{{{name}}} without sanitization, allowing link/query injection. Fix: Escape < and > in the greeting; strip ] [ | from name when used in the link target.

  2. User review #set unsanitizedTemplate/User review.mediawiki uses {{#set:Is reviewed={{{Reviewed|}}}}}. The form normally sends Yes/No, but the value can be tampered (e.g. via query string). A value containing ] or | can break the #set or inject. Fix: Strip ] [ | from Reviewed when used in #set.

Dependency: ParserFunctions with $wgPFEnableStringFunctions = true added to requiredExtensions and README.

GitHub issues can be filed separately for each finding. Jira SLOP task(s) to be created and linked when Jira is available.

Audit: Repo audit workflow; work performed by AI / Cursor Agent.

- Welcome: escape {{{name}}} in greeting (< and > to &lt; &gt;) to prevent XSS; sanitize name in formredlink target (strip ], [, |) to prevent link/query injection
- User review: sanitize {{{Reviewed|}}} when used in #set (strip ], [, |) to prevent SMW store injection
- Add ParserFunctions to requiredExtensions and README ($wgPFEnableStringFunctions = true)

Co-authored-by: Cursor <cursoragent@cursor.com>
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