CVE-2025-24981 Parsed HTML anchor links in Markdown provided to parseMarkdown can result in XSS in @nuxtjs/mdc
Attackers can execute arbitrary JavaScript via crafted Markdown anchor links bypassing protocol filters, affecting Nuxt applications using the MDC library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-24981?
CVE-2025-24981 is a critical cross-site scripting vulnerability in nuxt-modules mdc, published on 6 Feb 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
MDC is a tool to take regular Markdown and write documents interacting deeply with a Vue component. In affected versions unsafe parsing logic of the URL from markdown can lead to arbitrary JavaScript code due to a bypass to the existing guards around the `javascript:` protocol scheme in the URL. The parsing logic implement in `props.ts` maintains a deny-list approach to filtering potential malicious payload. It does so by matching protocol schemes like `javascript:` and others. These security guards can be bypassed by an adversarial that provides JavaScript URLs with HTML entities encoded via hex string. Users who consume this library and perform markdown parsing from unvalidated sources could result in rendering vulnerable XSS anchor links. This vulnerability has been addressed in version 0.13.3 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
Weakness: CWE-79
Which versions are affected by CVE-2025-24981?
2 open source packages ship an affected version, including @nuxtjs/mdc.
| Package | Affected | Fixed in |
|---|---|---|
@nuxtjs/mdc npm | All versions | 0.13.3 |
@nuxtjs/mdc npm | All versions | 0.13.3 |
How do I fix CVE-2025-24981?
Upgrade @nuxtjs/mdc to 0.13.3 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2025-24981 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-24981 exists.
Sources
Also known as GHSA-j82m-pc2v-2484.