Vulnerabilities in pkg:npm/md-editor-v3

PACKAGE
Advisory Identifier: GHSA-3rm2-h79c-8qw6
Advisory Summary

CVE-2026-84992 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting md-editor-v3 libraries in the npm ecosystem. The issue involves xss via fenced-code language rendering bypass. Remediation is available by upgrading affected packages to version 6.5.4.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/md-editor-v3

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/md-editor-v3. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-3rm2-h79c-8qw6 CVE-2026-84992 MODERATE md-editor-v3: XSS via fenced-code language rendering bypass

CVE-2026-84992 at a Glance

CVE Identifier CVE-2026-84992
GHSA Identifier GHSA-3rm2-h79c-8qw6
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product md-editor-v3
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-84992

To remediate this vulnerability, upgrade all affected md-editor-v3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

md-editor-v3 fixed: 6.5.4
npm install md-editor-v3@6.5.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls md-editor-v3

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-84992, inspect your project dependencies using npm:

npm ls md-editor-v3

Analyze the terminal output to locate any version of md-editor-v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.5.4), your application is affected.

Note: The npm ls md-editor-v3 command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In md-editor-v3, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `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`: ```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: ```sh 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.

CVE-2026-84992 Affected md-editor-v3 Versions

1 component(s)
Fixed Versions:
6.5.4
Product / Package Ecosystem Affected Versions Fixed Version
md-editor-v3
npm
< 6.5.4
6.5.4

References

Frequently Asked Questions

What is CVE-2026-84992?
CVE-2026-84992 is a security vulnerability in md-editor-v3 involving XSS via fenced-code language rendering bypass under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which md-editor-v3 versions are affected?
Affected versions include releases prior to 6.5.4 across affected packages: md-editor-v3.
What version fixes CVE-2026-84992?
Upgrading to 6.5.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is md-editor-v3 affected?
Yes, md-editor-v3 is affected in releases prior to 6.5.4. Upgrade your dependency to 6.5.4 or later.
What is the CVSS score of CVE-2026-84992?
CVE-2026-84992 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-84992?
CVE-2026-84992 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-84992?
Run the dependency tree command: 'npm ls md-editor-v3'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3rm2-h79c-8qw6",
  "modified" : "2026-09-18T17:17:36Z",
  "published" : "2026-09-18T17:17:36Z",
  "aliases" : [ "CVE-2026-84992" ],
  "summary" : "md-editor-v3: XSS via fenced-code language rendering bypass",
  "details" : "### 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "md-editor-v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.5.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.5.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/imzbf/md-editor-v3/security/advisories/GHSA-3rm2-h79c-8qw6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/imzbf/md-editor-v3/commit/2c07360420e74087f5bc63032ab155d93e0a0b10"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/imzbf/md-editor-v3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/imzbf/md-editor-v3/releases/tag/v6.5.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-18T17:17:36Z",
    "nvd_published_at" : null
  }
}