CVE-2025-61682: Mediawiki/semantic media wiki Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-hg8h-557g-q8pp
CVSS 8.6
CWE-79
Published
Advisory Summary

CVE-2025-61682 is a HIGH (CVSS 8.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Mediawiki/semantic media wiki libraries in the Packagist ecosystem. The issue involves semantic mediawiki vulnerable to stored xss through wikitext via improper use of non-reserved data attributes. Remediation is available by upgrading affected packages to version 7.0.0.

CVE-2025-61682 at a Glance

CVE Identifier CVE-2025-61682
GHSA Identifier GHSA-hg8h-557g-q8pp
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Mediawiki/semantic media wiki
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-61682

To remediate this vulnerability, upgrade all affected Mediawiki/semantic media wiki dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mediawiki/semantic-media-wiki fixed: 7.0.0
Upgrade mediawiki/semantic-media-wiki to 7.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for mediawiki/semantic-media-wiki

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-61682, inspect your project dependencies for Mediawiki/semantic media wiki:

inspect dependencies for mediawiki/semantic-media-wiki

Analyze the terminal output to locate any version of Mediawiki/semantic media wiki in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Mediawiki/semantic media wiki, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2025-61682 Affected Mediawiki/semantic media wiki Versions

1 component(s)
Fixed Versions:
7.0.0
Product / Package Ecosystem Affected Versions Fixed Version
mediawiki/semantic-media-wiki
Packagist
≥ 3.1.0
< 7.0.0
7.0.0

References

Frequently Asked Questions

What is CVE-2025-61682?
CVE-2025-61682 is a security vulnerability in Mediawiki/semantic media wiki involving Semantic MediaWiki vulnerable to stored XSS through wikitext via improper use of non-reserved data attributes under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Mediawiki/semantic media wiki versions are affected?
Affected versions include releases prior to 7.0.0 across affected packages: mediawiki/semantic-media-wiki.
What version fixes CVE-2025-61682?
Upgrading to 7.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mediawiki/semantic-media-wiki affected?
Yes, mediawiki/semantic-media-wiki is affected in releases prior to 7.0.0. Upgrade your dependency to 7.0.0 or later.
What is the CVSS score of CVE-2025-61682?
CVE-2025-61682 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L.
What CWE is associated with CVE-2025-61682?
CVE-2025-61682 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2025-61682?
Run the dependency tree command: 'inspect dependencies for mediawiki/semantic-media-wiki'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hg8h-557g-q8pp",
  "modified" : "2026-09-18T16:07:29Z",
  "published" : "2026-09-18T16:07:29Z",
  "aliases" : [ "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "mediawiki/semantic-media-wiki"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.1.0"
      }, {
        "fixed" : "7.0.0"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-18T16:07:29Z",
    "nvd_published_at" : null
  }
}