Summary
Short descriptions set via the ShortDescription extension are inserted as raw HTML by the Citizen skin, allowing any user to insert arbitrary HTML into the DOM by editing a page.
Details
The shortdesc
property, which contains unsanitized user input, is retrieved from the OutputPage and returned as the tagline:
|
$shortdesc = $this->out->getProperty( 'shortdesc' ); |
|
if ( $shortdesc ) { |
|
$tagline = $shortdesc; |
The tagline is then provided to the template data:
|
public function getTemplateData(): array { |
|
return [ |
|
'html-tagline' => $this->getTagline(), |
|
'html-title-heading' => $this->getPageHeading() |
|
]; |
|
} |
The template then inserts the tagline into raw HTML without doing any escaping:
|
<div id="siteSub">{{{html-tagline}}}</div> |
PoC
- Enable Citizen and ShortDescription
- Add
{{SHORTDESC:<img src="" onerror="alert('citizen shortdescription xss')">}}
to a page
- Visit the page


Impact
Arbitrary HTML can be inserted into the DOM by any user, allowing for JavaScript to be executed.
Summary
Short descriptions set via the ShortDescription extension are inserted as raw HTML by the Citizen skin, allowing any user to insert arbitrary HTML into the DOM by editing a page.
Details
The
shortdesc
property, which contains unsanitized user input, is retrieved from the OutputPage and returned as the tagline:mediawiki-skins-Citizen/includes/Components/CitizenComponentPageHeading.php
Lines 249 to 251 in 0d8a440
The tagline is then provided to the template data:
mediawiki-skins-Citizen/includes/Components/CitizenComponentPageHeading.php
Lines 270 to 275 in 0d8a440
The template then inserts the tagline into raw HTML without doing any escaping:
mediawiki-skins-Citizen/templates/PageHeading.mustache
Line 12 in 0d8a440
PoC
{{SHORTDESC:<img src="" onerror="alert('citizen shortdescription xss')">}}
to a pageImpact
Arbitrary HTML can be inserted into the DOM by any user, allowing for JavaScript to be executed.