Summary
A high-severity cross-site scripting vulnerability in @nuxtjs/mdc allows certain unsafe URLs in untrusted Markdown to bypass the sanitizer. Under specific rendering conditions, an attacker who can supply or influence Markdown content may cause JavaScript to execute in a user's browser or load active content through an opaque origin.
Affected context
The issue affects applications using @nuxtjs/mdc versions before the security fix when they render untrusted Markdown with dangerous HTML processing enabled. The vulnerable paths involve SVG link attributes represented through framework-style property names and iframe sources using data content, while several ordinary executable HTML URL forms are already filtered.
Exploit preconditions
- Attack surface: Markdown-to-Vue rendering in an application using @nuxtjs/mdc
- Required access: Ability to submit, modify, or cause the application to render attacker-controlled Markdown
- Trigger point: Sanitization and rendering of SVG link attributes or iframe source values
- Why exploitation is possible: Validation focuses on selected attribute names and compares some blocked schemes against an incomplete URL component, allowing specific active URL forms to bypass filtering
Why this happens
The vulnerability results from incomplete output sanitization and inconsistent normalization of URL-bearing attributes. The validator checks only conventional href and src names, so an equivalent SVG link property can avoid the intended unsafe-scheme checks; separately, filtering data content by comparing denylisted values with only the URL protocol does not identify the complete content type. This maps primarily to CWE-79: Improper Neutralization of Input During Web Page Generation, with CWE-184: Incomplete List of Disallowed Inputs describing the gaps in the sanitizer's denylist and attribute coverage.
Potential impact
- Arbitrary JavaScript may execute in the context of the affected page
- User sessions or page-visible data could be exposed
- An attacker could alter rendered content or perform actions available to the victim
- Embedded active content could execute in an opaque origin and affect application behavior
- The vulnerability could facilitate phishing, credential theft, or further client-side compromise
General mitigation guidance
Mitigation generally focuses on treating Markdown as untrusted content and applying complete, context-aware sanitization before rendering.
Common defensive patterns include:
- Disable dangerous HTML handling for untrusted Markdown unless a narrowly defined use case requires it
- Use a maintained sanitizer that normalizes URL attributes and covers SVG, iframe, object, and related embedding contexts
- Apply allowlists for elements, attributes, URL schemes, and permitted destinations rather than relying on partial denylists
- Validate the complete URL and relevant content type before rendering, including data-based sources
- Keep Markdown authoring and rendering privileges separate from trusted application content
- Apply browser security controls such as an appropriate Content Security Policy as defense in depth
How teams detect issues like this
Detection can combine dependency review with focused analysis of Markdown rendering and sanitization boundaries.
- Use software composition analysis to identify affected @nuxtjs/mdc dependency ranges and confirm that a maintained security-fixed release is in use.
- Perform static analysis for dangerous HTML rendering options, custom sanitizer hooks, and validators that inspect only literal
hreforsrcnames. - Review code for URL checks based solely on protocol fields, incomplete denylists, or missing SVG and embedded-content coverage.
- Add policy tests that render representative untrusted Markdown across HTML, SVG, iframe, and data-source contexts and verify that active content is rejected.
- Monitor browser security reports and application logs for unexpected inline execution or unusual Markdown submissions.

