Page descriptions are inserted into raw HTML without proper sanitization by the Citizen skin when using the old search bar.
The descriptions, which are unsanitized, are inserted as raw HTML: https://github.com/StarCitizenTools/mediawiki-skins-Citizen/blob/d4dfc3697a82948b3b9c4d44e9a273c79bc86b87/resources/skins.citizen.search/templates/TypeaheadListItem.mustache#L18
All of the reproduction methods require the command palette to be disabled via $wgCitizenEnableCommandPalette = false;
.
Additionally, the action API must be used as the Search Gateway via $wgCitizenSearchGateway = 'mwActionApi';
.
$wgCitizenSearchDescriptionSource = 'textextracts';
to your LocalSettings.phpCitizenXSSTextExtracts
and insert <img src="" onerror="alert('citizen search xss')">
into itCitizenXSSTextExtracts
$wgEnableMetaDescriptionFunctions = true;
to your LocalSettings.php to enable the {{#description2:}}
parser function$wgCitizenSearchDescriptionSource = 'pagedescription';
to your LocalSettings.phpCitizenXSSDescription2
and insert {{#description2:<img src="" onerror="alert('citizen search xss 2')">}}
into itCitizenXSSDescription2
Note that this method is currently untested due to issues I experienced when setting up Wikibase.
$wgCitizenSearchDescriptionSource = 'wikidata';
to your LocalSettings.php<img src="" onerror="alert('citizen search xss 3')">
$wgCitizenSearchDescriptionSource = 'wikidata';
to your LocalSettings.phpCitizenXSSDescription4
and insert {{SHORTDESC:<img src="" onerror="alert('citizen search xss 4')">}}
into itCitizenXSSDescription4
On all wikis that use the aforementioned settings (command palette disabled or using an old release where the old search bar is still used; using the action API as the search gateway), anybody who can edit pages is able to insert XSS payloads into the DOM for other users who are searching for specific pages.
{ "github_reviewed": true, "nvd_published_at": "2025-07-03T20:15:23Z", "severity": "HIGH", "cwe_ids": [ "CWE-79" ], "github_reviewed_at": "2025-07-03T20:29:08Z" }