{"id":"CVE-2025-61682","aliases":["GHSA-hg8h-557g-q8pp"],"url":"https://o3.security/vulnerability/CVE-2025-61682","summary":"Semantic MediaWiki vulnerable to stored XSS through wikitext via improper use of non-reserved data attributes","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 `&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.\n\n### PoC\n\n1. Create a page with the following contents:\n```html\n{{#tag:div|\n|class=smw-subtab\n|data-subtab=\"\"<img src='' onerror=alert(1)>\"\"\n}}\n```\n2. Visit the page\n\n<img width=\"991\" height=\"465\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5d28d852-72d6-41dc-a59a-faac1610015f\" />\n<img width=\"497\" height=\"69\" alt=\"image\" src=\"https://github.com/user-attachments/assets/02309390-0b40-46d9-b690-de8cd25dba59\" />\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.","published":"2026-09-18T16:09:06.880Z","modified":"2026-10-28T02:30:53.688795993Z","cvss":{"score":8.6,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"Packagist","name":"mediawiki/semantic-media-wiki","fixedVersion":"7.0.0"}],"fix":null,"references":[{"type":"WEB","url":"https://github.com/SemanticMediaWiki/SemanticMediaWiki/releases/tag/7.0.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/61xxx/CVE-2025-61682.json"},{"type":"ADVISORY","url":"https://github.com/SemanticMediaWiki/SemanticMediaWiki/security/advisories/GHSA-hg8h-557g-q8pp"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-61682"},{"type":"PACKAGE","url":"https://github.com/SemanticMediaWiki/SemanticMediaWiki"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:53.688795993Z"}}