- Package
- mediawiki/semantic-media-wiki
- Fixed in
- 7.0.0
- Published
- Fri 18 Sep 2026, 17:07 LisbonUpdated Sun 25 Oct 2026, 23:26 Lisbon
- Installs on Packagist
- 405K
In plain words
A user with the edit right can store malicious wikitext that runs JavaScript in the browser of someone viewing the page. Semantic MediaWiki treats an unsanitised data attribute as HTML, allowing stored cross-site scripting.
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| mediawiki/semantic-media-wiki | >= 3.1.0, < 7.0.0 | 7.0.0 |
Am I affected?
Look for mediawiki/semantic-media-wiki in composer.lock. Versions from 3.1.0 up to but not including 7.0.0 are affected; 7.0.0 is fixed. Check who has the edit right and can add wikitext. The vulnerable handling is in ext.smw.js, which inserts the data-subtab value from elements with the smw-subtab class as HTML.
What to do
Check which version you have, then update to a fixed release for your branch (7.0.0):
composer show mediawiki/semantic-media-wiki | grep versions
composer update mediawiki/semantic-media-wiki
If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.
The advisory's description
Summary
The SemanticMediaWiki extension inserts the unsanitized value of a data attribute into the DOM as HTML, allowing for stored XSS through wikitext.
Details
In ext.smw.js, the data-subtab attribute of all elements with the smw-subtab class is parsed as JSON and appended to the innerHTML of the element:
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/62f1fa765b626e21d88999b97a3e8029db9fd385/res/smw/ext.smw.js#L37-L42
However, most data attributes (except for reserved ones) like data-subtab can be used in wikitext. Therefore, it is possible to insert arbitrary HTML and JS through wikitext.
The decoded (" will turn to ", but it will be decoded when it is retrieved through .dataset) value of the data-subtab attribute in the payload is "<img src='' onerror=alert(1)>". This is valid JSON and returns a string with <img src='' onerror=alert(1)> when being decoded.
PoC
- Create a page with the following contents:
{{#tag:div|
|class=smw-subtab
|data-subtab=""<img src='' onerror=alert(1)>""
}}
- Visit the page
Impact
Arbitrary HTML can be inserted into the DOM by any user with the edit right, allowing for JavaScript to be executed.
Weakness: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). Reported by SomeMWDev.
The advisory
- GitHub Advisory Database: GHSA-hg8h-557g-q8pp, with who is affected and how
- OSV.dev: GHSA-hg8h-557g-q8pp
- The week's digest, with the other advisories from 14 Sep 2026
- All advisories for mediawiki/semantic-media-wiki