# 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.

- **Severity:** Critical 9.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Feb 2025
- **Updated:** 12 Feb 2025
- **Also known as:** GHSA-j82m-pc2v-2484

## 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 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2025-24981?

2 open source packages ship an affected version, including @nuxtjs/mdc.


| Package | Ecosystem | 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.

## Is CVE-2025-24981 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-24981 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-24981 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-24981 exists.

Affected packages and fixed versions:
- @nuxtjs/mdc (npm): affected all versions; fixed in 0.13.3
- @nuxtjs/mdc (npm): affected all versions; fixed in 0.13.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-24981/ (Markdown: https://insights.sbomify.com/CVE-2025-24981/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-24981
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-24981
- OSV: https://osv.dev/vulnerability/CVE-2025-24981

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-24981/
Summaries are generated and may contain mistakes; the official description above is the record.
