CVE-2025-24981: @nuxtjs/mdc Cross-Site Scripting Vulnerability
CRITICALCVE-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
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).
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.
npm install @nuxtjs/mdc@0.13.3
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
CVE-2025-24981 Affected @nuxtjs/mdc Versions
1 component(s)| 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?
Which @nuxtjs/mdc versions are affected?
What version fixes CVE-2025-24981?
Is @nuxtjs/mdc affected?
What is the CVSS score of CVE-2025-24981?
What CWE is associated with CVE-2025-24981?
How can I check npm dependencies for CVE-2025-24981?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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	ascript:alert('XSS');\">Click Me 1</a>\n\n- Bypass 2:\n\n<a href=\"jav
ascript:alert('XSS');\">Click Me 2</a>\n\n- Bypass 3:\n\n<a href=\"jav 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"
}
}