GHSA-j82m-pc2v-2484
CRITICALParsed HTML anchor links in Markdown provided to parseMarkdown can result in XSS in @nuxtjs/mdc
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
Weekly download volume for affected packages — a proxy for how broadly this vulnerability is deployed.
@nuxtjs/mdcnpmDescription
Summary
An 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.
Details
The parsing logic implement at https://github.com/nuxt-modules/mdc/blob/main/src/runtime/parser/utils/props.ts#L16 maintains a deny-list approach to filtering potential malicious payload. It does so by matching protocol schemes like javascript: and others.
Specifically, this is the code from the mdc library's parser that is not secure enough:
export const unsafeLinkPrefix = [
'javascript:',
'data:text/html',
'vbscript:',
'data:text/javascript',
'data:text/vbscript',
'data:text/css',
'data:text/plain',
'data:text/xml'
]
export const validateProp = (attribute: string, value: string) => {
if (attribute.startsWith('on')) {
return false
}
if (attribute === 'href' || attribute === 'src') {
return !unsafeLinkPrefix.some(prefix => value.toLowerCase().startsWith(prefix))
}
return true
}
These security guards can be bypassed by an adversarial that provides JavaScript URLs with HTML entities encoded via hex string.
PoC
The following URL payloads if provided to the markdown parsing library (such as through the usage of import { parseMarkdown } from '@nuxtjs/mdc/runtime';) will trigger the alert() dialog:
# ✅ This is correctly escaped by the parser
- XSS Attempt:
<a href="javascript:alert(1)"> this gets sanitizied, yay!</a>
# ❌ These are vulnerable and not escaped
- Bypass 1:
<a href="jav	ascript:alert('XSS');">Click Me 1</a>
- Bypass 2:
<a href="jav
ascript:alert('XSS');">Click Me 2</a>
- Bypass 3:
<a href="jav ascript:alert('XSS');">Click Me 3</a>
Impact
Users who consume this library and perform markdown parsing from unvalidated sources such as LLM generative text responses, user input and other untrusted sources could result in rendering vulnerable XSS anchor links.
Reference
You may infer the following write-up for more in-depth walkthrough of URL parsing problems and suggestions on how to securely address them: How to Parse URLs from Markdown to HTML Securely?
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @nuxtjs/mdc | all versions | 0.13.3 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @nuxtjs/mdc. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update @nuxtjs/mdc to 0.13.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-j82m-pc2v-2484 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-j82m-pc2v-2484 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-j82m-pc2v-2484. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-j82m-pc2v-2484 in your dependencies?
O3 detects GHSA-j82m-pc2v-2484 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.