GHSA-mxm6-v9r6-r94c: XSS

Published Sep 16, 2026
·
Updated

Summary

@nuxtjs/mdc renders untrusted markdown (including raw HTML) to a Vue component tree. Across two prior advisories it added a URL/attribute sanitizer to block dangerous links in that HTML: validateProps / validateProp and an unsafeLinkPrefix deny-list (dist/runtime/parser/utils/props.js). The sanitizer runs at parse time (dist/runtime/parser/compiler.js) and parseMarkdown enables raw HTML by default (allowDangerousHtml: true, dist/runtime/parser/options.js), so the sanitizer is the only barrier and it applies with no configuration required.

Two sibling vectors bypass that sanitizer at the default configuration:

1. SVG anchor xlink:href. validateProp only scheme-checks attributes named exactly href or src:

if (attribute === "href" || attribute === "src") return isAnchorLinkAllowed(value); return true;

An xlink:href (parsed to the hast property xLinkHref) is neither, so a javascript: URL on an SVG <a> is passed through. The renderer maps the property back to the real attribute (MDCRenderer.vue: find(html, "xLinkHref").attribute is xlink:href), so the output element is <a xlink:href="javascript:...">. Clicking it runs the script in the page origin. Plain <a href="javascript:..."> is correctly stripped, which is what makes this the un-patched sibling.

2. <iframe src="data:text/html,...">. data:text/html is present in unsafeLinkPrefix, but the check compares it against url.protocol:

if (unsafeLinkPrefix.some((prefix) => url.protocol.toLowerCase().startsWith(prefix))) return false;

For any data URI url.protocol is just "data:", so "data:".startsWith("data:text/html") is always false. Every data:text/ entry in the deny-list is therefore dead code, and <iframe src="data:text/html,<script>...</script>"> is allowed (iframe is not in the render-time dangerousTags, which is only ["script","base"]). The framed document executes script in an opaque origin. For contrast, srcdoc and object are blocked, so this is a precise gap rather than a general absence of filtering.

Reproduction

I will attach the zip file for POC, you can simply extract and run ./poc.sh to install mdc and show the poc in the html file. nuxtjs-mdc-xsspoc.zip

Two zero-argument checks:

1. sh poc/poc.sh installs @nuxtjs/mdc and runs parseMarkdown (the documented API) at default. It shows the parsed tree retains a { xLinkHref: "javascript:..." } and iframe { src: "data:text/html,..." }, while the control payloads href="javascript:..." and srcdoc=... are removed by the sanitizer. This isolates the sanitizer bypass deterministically. 2. poc/poc.sh also serves poc/poc.html over http (data: iframes and javascript: links are restricted under the file:// origin, so http is used). Open the printed URL and click the blue SVG link. The page contains the exact DOM the renderer produces for those parsed nodes; clicking the SVG link executes script in the page origin (same-origin), and the data:text/html iframe executes on load. The page prints VULNERABLE for each that fires.

Both vectors were confirmed executing in a current Chromium build: the SVG xlink:href link runs script in the document origin on click, and the data:text/html iframe runs script on load.

Suggested fix

In validateProp, scheme-check xlink:href (and the hast xLinkHref) the same way as href/src. In isAnchorLinkAllowed, compare the dangerous MIME-typed entries against the full URL (or href), not against url.protocol, so data:text/html is actually matched; or add iframe to the render-time dangerous-tag set / restrict iframe src schemes.

Affected Software

1 affected componentFixes available
npm/@nuxtjs/mdc<0.22.1
0.22.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@nuxtjs/mdc to a version that resolves this vulnerability.

    Fixed in 0.22.1
  2. Configuration

    In the sanitizer function isAnchorLinkAllowed, compare dangerous MIME-typed deny-list entries against the full URL/href value (or href attribute) rather than url.protocol, so that a URL like "data:text/html,..." is correctly matched and blocked.

    @nuxtjs/mdc (HTML sanitizer, dist/runtime/parser/utils/props.js) unsafeLinkPrefix deny-list matching logic = Match against the full URL/href (e.g., value) rather than url.protocol; specifically ensure entries like "data:text/html" are checked against the complete scheme+path string so "data:text/html" is not missed.
  3. Configuration

    In validateProp, add scheme-checking for SVG anchor links via the xlink:href attribute (and the HAST property xLinkHref), using the same unsafe scheme deny-list logic as for href and src.

    @nuxtjs/mdc (property validation, validateProp in dist/runtime/parser/utils/props.js) scheme-check for xlink:href / xLinkHref = Apply the same scheme-check as for href/src to xlink:href (HAST property xLinkHref), so values like "javascript:..." are denied.
  4. Configuration

    Change parseMarkdown usage so raw HTML is not enabled by default (allowDangerousHtml: false) to avoid relying on the sanitizer as the only barrier when rendering untrusted markdown.

    @nuxtjs/mdc (renderer parsing enablement) allowDangerousHtml = true (default)
  5. Compensating control

    Restrict iframe usage (e.g., block iframe src to data: and javascript-capable schemes) at the render-time policy level by adding iframe handling to the render-time dangerous tags set or by enforcing a scheme restriction for iframe src so that <iframe src="data:text/html,..."> cannot execute.

Event History

Sep 16, 2026
Advisory Published
via GitHub·10:14 PM
Data Sourced
via GitHub·10:14 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed?

Deployments that render untrusted Markdown with @nuxtjs/mdc are exposed under the default configuration. Raw HTML is enabled by default, and the URL/attribute sanitizer is applied automatically but can be bypassed.

2

What must an attacker do for exploitation to succeed?

An attacker needs to get crafted Markdown containing raw SVG HTML rendered by the application. Exploitation of the documented xlink:href vector requires a user to click the resulting SVG link with a javascript: URL.

3

How can I check for the documented bypass in rendered content?

Inspect rendered Markdown output for SVG anchor elements using an xlink:href attribute. An element such as an SVG <a> with xlink:href set to a javascript: URL indicates the sanitizer bypass described in the advisory.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203