GHSA-HG8H-557G-Q8PP
Vulnerability from github – Published: 2026-09-18 16:07 – Updated: 2026-09-18 16:07Summary
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.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "mediawiki/semantic-media-wiki"
},
"ranges": [
{
"events": [
{
"introduced": "3.1.0"
},
{
"fixed": "7.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-61682"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-18T16:07:29Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\nThe SemanticMediaWiki extension inserts the unsanitized value of a data attribute into the DOM as HTML, allowing for stored XSS through wikitext.\n\n### Details\n\nIn `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:\nhttps://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/62f1fa765b626e21d88999b97a3e8029db9fd385/res/smw/ext.smw.js#L37-L42\nHowever, 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.\nThe decoded (`\"` will turn to `\u0026quot;`, but it will be decoded when it is retrieved through `.dataset`) value of the `data-subtab` attribute in the payload is `\"\u003cimg src=\u0027\u0027 onerror=alert(1)\u003e\"`. This is valid JSON and returns a string with `\u003cimg src=\u0027\u0027 onerror=alert(1)\u003e` when being decoded.\n\n### PoC\n\n1. Create a page with the following contents:\n```html\n{{#tag:div|\n|class=smw-subtab\n|data-subtab=\"\"\u003cimg src=\u0027\u0027 onerror=alert(1)\u003e\"\"\n}}\n```\n2. Visit the page\n\n\u003cimg width=\"991\" height=\"465\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5d28d852-72d6-41dc-a59a-faac1610015f\" /\u003e\n\u003cimg width=\"497\" height=\"69\" alt=\"image\" src=\"https://github.com/user-attachments/assets/02309390-0b40-46d9-b690-de8cd25dba59\" /\u003e\n\n### Impact\n\nArbitrary HTML can be inserted into the DOM by any user with the `edit` right, allowing for JavaScript to be executed.",
"id": "GHSA-hg8h-557g-q8pp",
"modified": "2026-09-18T16:07:29Z",
"published": "2026-09-18T16:07:29Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/SemanticMediaWiki/SemanticMediaWiki/security/advisories/GHSA-hg8h-557g-q8pp"
},
{
"type": "PACKAGE",
"url": "https://github.com/SemanticMediaWiki/SemanticMediaWiki"
},
{
"type": "WEB",
"url": "https://github.com/SemanticMediaWiki/SemanticMediaWiki/releases/tag/7.0.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "Semantic MediaWiki vulnerable to stored XSS through wikitext via improper use of non-reserved data attributes"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.