{"id":"CVE-2025-24981","aliases":["CVE-2025-24981","GHSA-j82m-pc2v-2484"],"related":[],"kind":"vulnerability","state":"published","title":"Parsed HTML anchor links in Markdown provided to parseMarkdown can result in XSS in @nuxtjs/mdc","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nAn 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.\n\n### Details\n\nThe parsing logic implement at [https://github.com/nuxt-modules/mdc/blob/main/src/runtime/parser/utils/props.ts#L16](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.\n\nSpecifically, this is the code from the mdc library's parser that is not secure enough:\n\n```js\nexport const unsafeLinkPrefix = [\n  'javascript:',\n  'data:text/html',\n  'vbscript:',\n  'data:text/javascript',\n  'data:text/vbscript',\n  'data:text/css',\n  'data:text/plain',\n  'data:text/xml'\n]\n\nexport const validateProp = (attribute: string, value: string) => {\n  if (attribute.startsWith('on')) {\n    return false\n  }\n\n  if (attribute === 'href' || attribute === 'src') {\n    return !unsafeLinkPrefix.some(prefix => value.toLowerCase().startsWith(prefix))\n  }\n\n  return true\n}\n```\n\nThese security guards can be bypassed by an adversarial that provides JavaScript URLs with HTML entities encoded via hex string.\n\n### PoC\n\nThe 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:\n\n```markdown\n# ✅ This is correctly escaped by the parser\n\n- XSS Attempt:\n\n<a href=\"javascript:alert(1)\"> this gets sanitizied, yay!</a>\n\n# ❌ These are vulnerable and not escaped\n\n- Bypass 1:\n\n<a href=\"jav&#x09;ascript:alert('XSS');\">Click Me 1</a>\n\n- Bypass 2:\n\n<a href=\"jav&#x0A;ascript:alert('XSS');\">Click Me 2</a>\n\n- Bypass 3:\n\n<a href=\"jav&#10;ascript:alert('XSS');\">Click Me 3</a>\n```\n\n### Impact\n\nUsers 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.\n\n## Reference\n\nYou 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?](https://www.nodejs-security.com/blog/how-to-parse-urls-from-markdown-to-html-securely)","format":"markdown","source":"ghsa"},{"lang":"es","text":"MDC es una herramienta para tomar Markdown regular y escribir documentos que interactúan profundamente con un componente Vue. En las versiones afectadas, la lógica de análisis insegura de la URL de Markdown puede generar código JavaScript arbitrario debido a una omisión de las protecciones existentes en torno al esquema de protocolo `javascript:` en la URL. La lógica de análisis implementada en `props.ts` mantiene un enfoque de lista de denegación para filtrar el payload malicioso potencial. Lo hace al hacer coincidir esquemas de protocolo como `javascript:` y otros. Estas protecciones de seguridad pueden ser omitidas por un adversario que proporcione URL de JavaScript con entidades HTML codificadas a través de una cadena hexadecimal. Los usuarios que consumen esta librería y realizan análisis de Markdown desde fuentes no validadas podrían generar enlaces de anclaje XSS vulnerables. Esta vulnerabilidad se ha solucionado en la versión 0.13.3 y se recomienda a todos los usuarios que actualicen. No existen workarounds para esta vulnerabilidad.","source":"nvd"}],"published":"2025-02-06T17:16:27.000Z","modified":"2026-06-17T08:59:55.240Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L","score":9.3,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L","score":9.3,"rating":"CRITICAL"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 0.13.3","status":"affected"}],"vendor":"nuxt-modules","product":"mdc","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.13.3"}],"ecosystem":"npm","package":"@nuxtjs/mdc","purl":"pkg:npm/%40nuxtjs/mdc","source":"ghsa"}],"references":[{"url":"https://github.com/nuxt-modules/mdc/security/advisories/GHSA-j82m-pc2v-2484","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nuxt-modules/mdc/commit/99097738b5561639e9bf247c55d8103236618bf3","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nuxt-modules/mdc/blob/main/src/runtime/parser/utils/props.ts#L16","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24981","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nuxt-modules/mdc","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-02-06T19:33:19.101Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-24981","url":"https://www.cve.org/CVERecord?id=CVE-2025-24981","licence":"CVE Terms of Use","modified":"2025-02-12T19:51:09.012Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j82m-pc2v-2484","url":"https://github.com/advisories/GHSA-j82m-pc2v-2484","licence":"CC-BY-4.0","modified":"2025-02-13T16:49:46.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-24981","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24981","licence":"Public domain","modified":"2026-06-17T08:59:55.240Z"}],"updatedAt":"2026-11-25T22:58:53.882Z","epss":{"score":0.00698,"percentile":0.54373,"date":"2026-12-01T12:00:22.000Z"}}