GHSA-hg8h-557g-q8pp: XSS

Published Sep 18, 2026
·
Updated

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 &quot;, 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

1. Create a page with the following contents: html {{#tag:div| |class=smw-subtab |data-subtab=""<img src='' onerror=alert(1)>"" }} 2. Visit the page

<img width="991" height="465" alt="image" src="https://github.com/user-attachments/assets/5d28d852-72d6-41dc-a59a-faac1610015f" /> <img width="497" height="69" alt="image" src="https://github.com/user-attachments/assets/02309390-0b40-46d9-b690-de8cd25dba59" />

Impact

Arbitrary HTML can be inserted into the DOM by any user with the edit right, allowing for JavaScript to be executed.

Affected Software

1 affected componentFixes available
composer/mediawiki/semantic-media-wiki>=3.1.0<7.0.0
7.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/mediawiki/semantic-media-wiki to a version that resolves this vulnerability.

    Fixed in 7.0.0

Event History

Sep 18, 2026
Advisory Published
via GitHub·04:07 PM
Data Sourced
via GitHub·04:07 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What access does an attacker need to exploit this issue?

The proof of concept requires the attacker to create a wiki page containing wikitext that sets the smw-subtab class and a data-subtab attribute. The supplied CVSS vector rates privileges required as none, but actual ability to create or edit such content depends on the wiki's configured editing permissions.

2

Who is exposed when malicious content is present?

Users who visit a page containing the crafted wikitext can have arbitrary HTML and JavaScript inserted into the page DOM. The CVSS vector indicates no user interaction is required beyond reaching the affected page.

3

How can administrators look for potentially malicious stored content?

Review wiki pages and templates for uses of the smw-subtab class, particularly data-subtab attributes supplied through wikitext or #tag constructs. Treat values that decode as JSON strings containing HTML, such as image tags with event handlers, as suspicious.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203