CVE-2025-24981: @nuxtjs/mdc Cross-Site Scripting Vulnerability

CRITICAL
Advisory Identifier: GHSA-j82m-pc2v-2484
CVSS 9.3
CWE-79
Published
Advisory Summary

CVE-2025-24981 is a CRITICAL (CVSS 9.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @nuxtjs/mdc libraries in the npm ecosystem. The issue involves parsed html anchor links in markdown provided to parsemarkdown can result in xss in @nuxtjs/mdc. Remediation is available by upgrading affected packages to version 0.13.3.

CVE-2025-24981 at a Glance

CVE Identifier CVE-2025-24981
GHSA Identifier GHSA-j82m-pc2v-2484
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @nuxtjs/mdc
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.3

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:C/C:H/I:N/A:L).

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

How to Fix CVE-2025-24981

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

@nuxtjs/mdc fixed: 0.13.3
npm install @nuxtjs/mdc@0.13.3
Verify Direct and Transitive Dependencies

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

npm ls @nuxtjs/mdc

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-24981, inspect your project dependencies using npm:

npm ls @nuxtjs/mdc

Analyze the terminal output to locate any version of @nuxtjs/mdc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.3), your application is affected.

Note: The npm ls @nuxtjs/mdc command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

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 @nuxtjs/mdc, 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 An unsafe parsing logic of the URL from markdown can lead to arbitrary JavaScript code due to a bypass to the existing guards around the `javascript:` protocol scheme in the URL. ### Details The parsing logic implement at [https://github.com/nuxt-modules/mdc/blob/main/src/runtime/parser/utils/props.ts#L16](https://github.com/nuxt-modules/mdc/blob/main/src/runtime/parser/utils/props.ts#L16) maintains a deny-list approach to filtering potential malicious payload. It does so by matching protocol schemes like `javascript:` and others. Specifically, this is the code from the mdc library's parser that is not secure enough: ```js export const unsafeLinkPrefix = [ 'javascript:', 'data:text/html', 'vbscript:', 'data:text/javascript', 'data:text/vbscript', 'data:text/css', 'data:text/plain', 'data:text/xml' ] export const validateProp = (attribute: string, value: string) => { if (attribute.startsWith('on')) { return false } if (attribute === 'href' || attribute === 'src') { return !unsafeLinkPrefix.some(prefix => value.toLowerCase().startsWith(prefix)) } return true } ``` These security guards can be bypassed by an adversarial that provides JavaScript URLs with HTML entities encoded via hex string. ### PoC The following URL payloads if provided to the markdown parsing library (such as through the usage of `import { parseMarkdown } from '@nuxtjs/mdc/runtime';`) will trigger the alert() dialog: ```markdown # ✅ This is correctly escaped by the parser - XSS Attempt: <a href="javascript:alert(1)"> this gets sanitizied, yay!</a> # ❌ These are vulnerable and not escaped - Bypass 1: <a href="jav&#x09;ascript:alert('XSS');">Click Me 1</a> - Bypass 2: <a href="jav&#x0A;ascript:alert('XSS');">Click Me 2</a> - Bypass 3: <a href="jav&#10;ascript:alert('XSS');">Click Me 3</a> ``` ### Impact Users who consume this library and perform markdown parsing from unvalidated sources such as LLM generative text responses, user input and other untrusted sources could result in rendering vulnerable XSS anchor links. ## Reference You may infer the following write-up for more in-depth walkthrough of URL parsing problems and suggestions on how to securely address them: [How to Parse URLs from Markdown to HTML Securely?](https://www.nodejs-security.com/blog/how-to-parse-urls-from-markdown-to-html-securely)

CVE-2025-24981 Affected @nuxtjs/mdc Versions

1 component(s)
Fixed Versions:
0.13.3
Product / Package Ecosystem Affected Versions Fixed Version
@nuxtjs/mdc
npm
< 0.13.3
0.13.3

References

Frequently Asked Questions

What is CVE-2025-24981?
CVE-2025-24981 is a security vulnerability in @nuxtjs/mdc involving Parsed HTML anchor links in Markdown provided to parseMarkdown can result in XSS in @nuxtjs/mdc under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @nuxtjs/mdc versions are affected?
Affected versions include releases prior to 0.13.3 across affected packages: @nuxtjs/mdc.
What version fixes CVE-2025-24981?
Upgrading to 0.13.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nuxtjs/mdc affected?
Yes, @nuxtjs/mdc is affected in releases prior to 0.13.3. Upgrade your dependency to 0.13.3 or later.
What is the CVSS score of CVE-2025-24981?
CVE-2025-24981 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L.
What CWE is associated with CVE-2025-24981?
CVE-2025-24981 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 npm dependencies for CVE-2025-24981?
Run the dependency tree command: 'npm ls @nuxtjs/mdc'. 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-j82m-pc2v-2484",
  "modified" : "2025-02-13T16:49:46Z",
  "published" : "2025-02-06T17:16:27Z",
  "aliases" : [ "CVE-2025-24981" ],
  "summary" : "Parsed HTML anchor links in Markdown provided to parseMarkdown can result in XSS in @nuxtjs/mdc",
  "details" : "### Summary\nAn unsafe parsing logic of the URL from markdown can lead to arbitrary JavaScript code due to a bypass to the existing guards around the `javascript:` protocol scheme in the URL.\n\n### Details\n\nThe parsing logic implement at [https://github.com/nuxt-modules/mdc/blob/main/src/runtime/parser/utils/props.ts#L16](https://github.com/nuxt-modules/mdc/blob/main/src/runtime/parser/utils/props.ts#L16) maintains a deny-list approach to filtering potential malicious payload. It does so by matching protocol schemes like `javascript:` and others.\n\nSpecifically, this is the code from the mdc library's parser that is not secure enough:\n\n```js\nexport const unsafeLinkPrefix = [\n  'javascript:',\n  'data:text/html',\n  'vbscript:',\n  'data:text/javascript',\n  'data:text/vbscript',\n  'data:text/css',\n  'data:text/plain',\n  'data:text/xml'\n]\n\nexport const validateProp = (attribute: string, value: string) => {\n  if (attribute.startsWith('on')) {\n    return false\n  }\n\n  if (attribute === 'href' || attribute === 'src') {\n    return !unsafeLinkPrefix.some(prefix => value.toLowerCase().startsWith(prefix))\n  }\n\n  return true\n}\n```\n\nThese security guards can be bypassed by an adversarial that provides JavaScript URLs with HTML entities encoded via hex string.\n\n### PoC\n\nThe following URL payloads if provided to the markdown parsing library (such as through the usage of `import { parseMarkdown } from '@nuxtjs/mdc/runtime';`) will trigger the alert() dialog:\n\n```markdown\n# ✅ This is correctly escaped by the parser\n\n- XSS Attempt:\n\n<a href=\"javascript:alert(1)\"> this gets sanitizied, yay!</a>\n\n# ❌ These are vulnerable and not escaped\n\n- Bypass 1:\n\n<a href=\"jav&#x09;ascript:alert('XSS');\">Click Me 1</a>\n\n- Bypass 2:\n\n<a href=\"jav&#x0A;ascript:alert('XSS');\">Click Me 2</a>\n\n- Bypass 3:\n\n<a href=\"jav&#10;ascript:alert('XSS');\">Click Me 3</a>\n```\n\n### Impact\n\nUsers who consume this library and perform markdown parsing from unvalidated sources such as LLM generative text responses, user input and other untrusted sources could result in rendering vulnerable XSS anchor links.\n\n## Reference\n\nYou may infer the following write-up for more in-depth walkthrough of URL parsing problems and suggestions on how to securely address them: [How to Parse URLs from Markdown to HTML Securely?](https://www.nodejs-security.com/blog/how-to-parse-urls-from-markdown-to-html-securely)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nuxtjs/mdc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.13.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.13.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nuxt-modules/mdc/security/advisories/GHSA-j82m-pc2v-2484"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-24981"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nuxt-modules/mdc/commit/99097738b5561639e9bf247c55d8103236618bf3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nuxt-modules/mdc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nuxt-modules/mdc/blob/main/src/runtime/parser/utils/props.ts#L16"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-06T17:16:27Z",
    "nvd_published_at" : "2025-02-06T18:15:32Z"
  }
}