GitHub Advisoryadvisory · Packagist

GHSA-hg8h-557g-q8pp Semantic MediaWiki vulnerable to stored XSS through wikitext via improper use of non-reserved data attributes

HIGH Published 2026-09-18 Modified 2026-09-18 Official page ↗
Aliases
CVE-2025-61682
Ecosystem
Packagist
Packages
mediawiki/semantic-media-wiki
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L
Weaknesses
CWE-79
Reviewed
2026-09-18

Affected packages

• Packagist mediawiki/semantic-media-wiki: >= 3.1.0, < 7.0.0 → fixed in 7.0.0

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 `&quot;`, but it will be decoded when it is retrieved through `.dataset`) value of the `data-subtab` attribute in the payload is `""`. This is valid JSON and returns a string with `` when being decoded. PoC 1. Create a page with the following contents: ```html {{#tag:div| |class=smw-subtab |data-subtab="""" }} ``` 2. 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.

Related

Alias · CVE (1)

  • CVE-2025-61682 Semantic MediaWiki is a free, open-source extension to MediaWiki that lets users store and query data within the wiki's pages. vulnerability

Weakness · CWE (1)

  • CWE-79 Improper Neutralization of Input During Web Page Generation weakness

References