CVE-2025-46558: Syntax markdown commonmark12 Cross-Site Scripting Vulnerability

CRITICAL
Advisory Identifier: GHSA-8g2j-rhfh-hq3r
CVSS 9.0
CWE-79
Published
Advisory Summary

CVE-2025-46558 is a CRITICAL (CVSS 9.0) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Syntax markdown commonmark12 libraries in the Maven ecosystem. The issue involves syntax-markdown-commonmark12 vulnerable to xss via markdown content. Remediation is available by upgrading affected packages to version 8.9.

CVE-2025-46558 at a Glance

CVE Identifier CVE-2025-46558
GHSA Identifier GHSA-8g2j-rhfh-hq3r
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Syntax markdown commonmark12
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.0

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

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

How to Fix CVE-2025-46558

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

org.xwiki.contrib.markdown:syntax-markdown-commonmark12 fixed: 8.9
<dependency>
    <groupId>org.xwiki.contrib.markdown</groupId>
    <artifactId>syntax-markdown-commonmark12</artifactId>
    <version>8.9</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=org.xwiki.contrib.markdown

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2025-46558, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.xwiki.contrib.markdown

Analyze the terminal output to locate any version of Syntax markdown commonmark12 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.9), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.xwiki.contrib.markdown command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

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 Syntax markdown commonmark12, 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

### Impact The Markdown syntax is vulnerable to XSS through HTML. In particular, using Markdown syntax, it's possible for any user to embed Javascript code that will then be executed on the browser of any other user visiting either the document or the comment that contains it. In the instance that this code is executed by a user with admins or programming rights, this issue compromises the confidentiality, integrity and availability of the whole XWiki installation. To reproduce, on an instance where the CommonMark Markdown Syntax 1.2 extension is installed, log in as a user without script rights. Edit a document and set its syntax to Markdown. Then , add the content `<script>alert("XSS")</script>` and refresh the page. If an alert appears containing "XSS", then the instance is vulnerable. ### Patches This has been patched in version 8.9 of the CommonMark Markdown Syntax 1.2 extension. ### Workarounds We're not aware of any workaround except upgrading. ### References * https://jira.xwiki.org/browse/MARKDOWN-80 * https://github.com/xwiki-contrib/syntax-markdown/commit/d136472d6e8a47981a0ede420a9096f88ffa5035

CVE-2025-46558 Affected Syntax markdown commonmark12 Versions

1 component(s)
Fixed Versions:
8.9
Product / Package Ecosystem Affected Versions Fixed Version
org.xwiki.contrib.markdown:syntax-markdown-commonmark12
Maven
≥ 8.2
< 8.9
8.9

References

Frequently Asked Questions

What is CVE-2025-46558?
CVE-2025-46558 is a security vulnerability in Syntax markdown commonmark12 involving syntax-markdown-commonmark12 vulnerable to XSS via Markdown content under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Syntax markdown commonmark12 versions are affected?
Affected versions include releases prior to 8.9 across affected packages: org.xwiki.contrib.markdown:syntax-markdown-commonmark12.
What version fixes CVE-2025-46558?
Upgrading to 8.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is syntax-markdown-commonmark12 affected?
Yes, org.xwiki.contrib.markdown:syntax-markdown-commonmark12 is affected in releases prior to 8.9. Upgrade your dependency to 8.9 or later.
What is the CVSS score of CVE-2025-46558?
CVE-2025-46558 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2025-46558?
CVE-2025-46558 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 Maven dependencies for CVE-2025-46558?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.xwiki.contrib.markdown'. 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-8g2j-rhfh-hq3r",
  "modified" : "2025-05-01T13:30:39Z",
  "published" : "2025-04-30T16:53:27Z",
  "aliases" : [ "CVE-2025-46558" ],
  "summary" : "org.xwiki.contrib.markdown:syntax-markdown-commonmark12 vulnerable to XSS via Markdown content",
  "details" : "### Impact\nThe Markdown syntax is vulnerable to XSS through HTML. In particular, using Markdown syntax, it's possible for any user to embed Javascript code that will then be executed on the browser of any other user visiting either the document or the comment that contains it. In the instance that this code is executed by a user with admins or programming rights, this issue compromises the confidentiality, integrity and availability of the whole XWiki installation.\n\nTo reproduce, on an instance where the CommonMark Markdown Syntax 1.2 extension is installed, log in as a user without script rights. Edit a document and set its syntax to Markdown. Then , add the content `<script>alert(\"XSS\")</script>` and refresh the page. If an alert appears containing \"XSS\", then the instance is vulnerable.\n\n### Patches\nThis has been patched in version 8.9 of the CommonMark Markdown Syntax 1.2 extension.\n\n### Workarounds\nWe're not aware of any workaround except upgrading.\n\n### References\n* https://jira.xwiki.org/browse/MARKDOWN-80\n* https://github.com/xwiki-contrib/syntax-markdown/commit/d136472d6e8a47981a0ede420a9096f88ffa5035",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.contrib.markdown:syntax-markdown-commonmark12"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.2"
      }, {
        "fixed" : "8.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xwiki-contrib/syntax-markdown/security/advisories/GHSA-8g2j-rhfh-hq3r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-46558"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xwiki-contrib/syntax-markdown/commit/d136472d6e8a47981a0ede420a9096f88ffa5035"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xwiki-contrib/syntax-markdown"
  }, {
    "type" : "WEB",
    "url" : "https://jira.xwiki.org/browse/MARKDOWN-80"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-30T16:53:27Z",
    "nvd_published_at" : "2025-04-30T19:15:55Z"
  }
}