/

CVE-2026-54525

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Markdown Preview Enhanced

CVE-2026-54525

Awaiting Analysis

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Markdown Preview Enhanced for Visual Studio Code contains a command injection flaw in its Windows preview-link handling. When a Windows user opens an untrusted Markdown file and clicks a crafted external or unsupported-scheme link, attacker-controlled shell metacharacters may cause commands to run with the privileges of the current VS Code user.

Markdown Preview Enhanced for Visual Studio Code contains a command injection flaw in its Windows preview-link handling. When a Windows user opens an untrusted Markdown file and clicks a crafted external or unsupported-scheme link, attacker-controlled shell metacharacters may cause commands to run with the privileges of the current VS Code user.

Affected context

The vulnerability occurs in the Windows-specific handling of links opened from Markdown Preview Enhanced previews. It becomes risky when an untrusted Markdown document contains a link target that is decoded and passed to a shell-based file-opening helper. Exploitation depends on a user opening the preview and clicking the crafted link.

The vulnerability occurs in the Windows-specific handling of links opened from Markdown Preview Enhanced previews. It becomes risky when an untrusted Markdown document contains a link target that is decoded and passed to a shell-based file-opening helper. Exploitation depends on a user opening the preview and clicking the crafted link.

Exploit preconditions

  • Attack surface: Markdown Preview Enhanced link handling on Windows
  • Required access: Ability to provide or cause the victim to open an untrusted Markdown file
  • Trigger point: A user click on a crafted external or unsupported-scheme preview link
  • Why exploitation is possible: The decoded link target reaches a shell command without adequate separation from command syntax, allowing cmd.exe metacharacters to be interpreted as command separators
  • Attack surface: Markdown Preview Enhanced link handling on Windows
  • Required access: Ability to provide or cause the victim to open an untrusted Markdown file
  • Trigger point: A user click on a crafted external or unsupported-scheme preview link
  • Why exploitation is possible: The decoded link target reaches a shell command without adequate separation from command syntax, allowing cmd.exe metacharacters to be interpreted as command separators

Why this happens

The underlying bug is an OS command injection condition caused by passing attacker-influenced link data to a shell through child_process.exec and the Windows start command. Because the decoded target is treated as part of a shell command rather than as inert data or a safely separated process argument, shell metacharacters can alter command interpretation. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

The underlying bug is an OS command injection condition caused by passing attacker-influenced link data to a shell through child_process.exec and the Windows start command. Because the decoded target is treated as part of a shell command rather than as inert data or a safely separated process argument, shell metacharacters can alter command interpretation. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

Potential impact

  • An attacker-selected command may execute with the privileges of the current VS Code user
  • The attacker could access, modify, or delete data available to that user
  • Workspace or development credentials could be exposed
  • The compromise could be used for persistence or further lateral movement
  • Developer systems and software supply-chain assets could be affected
  • An attacker-selected command may execute with the privileges of the current VS Code user
  • The attacker could access, modify, or delete data available to that user
  • Workspace or development credentials could be exposed
  • The compromise could be used for persistence or further lateral movement
  • Developer systems and software supply-chain assets could be affected

General mitigation guidance

Mitigation generally focuses on preventing untrusted link data from reaching a command shell.

Common defensive patterns include:

  • Prefer direct process-spawning APIs that pass arguments separately instead of shell-evaluated command strings
  • Use a strict allowlist of supported URL schemes and reject unsupported or ambiguous targets
  • Treat decoded Markdown link targets as untrusted input and validate them before dispatch
  • Avoid shell metacharacter interpretation and apply platform-specific argument handling
  • Require explicit user confirmation before opening external resources
  • Run the editor and related tooling with least privilege and limit access to sensitive credentials

Mitigation generally focuses on preventing untrusted link data from reaching a command shell.

Common defensive patterns include:

  • Prefer direct process-spawning APIs that pass arguments separately instead of shell-evaluated command strings
  • Use a strict allowlist of supported URL schemes and reject unsupported or ambiguous targets
  • Treat decoded Markdown link targets as untrusted input and validate them before dispatch
  • Avoid shell metacharacter interpretation and apply platform-specific argument handling
  • Require explicit user confirmation before opening external resources
  • Run the editor and related tooling with least privilege and limit access to sensitive credentials

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings involving child_process.exec, shell command construction, or concatenated user-controlled arguments
  • Code-review signals showing decoded URLs or Markdown content passed to operating-system helpers
  • Tests covering shell metacharacters, unsupported schemes, encoded delimiters, and Windows-specific link behavior
  • Policy checks requiring direct argument APIs and rejecting unnecessary shell invocation
  • Endpoint telemetry showing unexpected child processes launched by the editor or its extensions

Organizations can look for:

  • Static-analysis findings involving child_process.exec, shell command construction, or concatenated user-controlled arguments
  • Code-review signals showing decoded URLs or Markdown content passed to operating-system helpers
  • Tests covering shell metacharacters, unsupported schemes, encoded delimiters, and Windows-specific link behavior
  • Policy checks requiring direct argument APIs and rejecting unnecessary shell invocation
  • Endpoint telemetry showing unexpected child processes launched by the editor or its extensions

Sources

SourceLink
github.comgithub.com/shd101wyy/crossnote/commit/5588ca2121c3da43fe331575dc5cf4ef347b91ee
github.comgithub.com/shd101wyy/crossnote/pull/442
github.comgithub.com/shd101wyy/crossnote/releases/tag/0.9.29
github.comgithub.com/shd101wyy/vscode-markdown-preview-enhanced/commit/dcd80281c986293b93d9f1af34ced64dcb230c77
github.comgithub.com/shd101wyy/vscode-markdown-preview-enhanced/pull/2318
github.comgithub.com/shd101wyy/vscode-markdown-preview-enhanced/releases/tag/0.8.28
github.comgithub.com/shd101wyy/vscode-markdown-preview-enhanced/security/advisories/GHSA-7v6f-3vq6-r373

Frequently asked

questions

It can be triggered through content delivered to a victim, but exploitation requires the victim to open the untrusted Markdown file and click the crafted preview link.

No direct system access is necessarily required. The attacker needs a way to provide or induce the victim to open the malicious Markdown content, and the victim must perform the link click.

Avoid passing untrusted link targets to shell-evaluated commands. Use direct process APIs with separated arguments, strict scheme validation, and explicit handling for unsupported targets.

Treat all Markdown-controlled links as untrusted, test platform-specific link handlers with shell metacharacters, enforce secure process-spawning policies, and apply least privilege to development tools.

It can be triggered through content delivered to a victim, but exploitation requires the victim to open the untrusted Markdown file and click the crafted preview link.

No direct system access is necessarily required. The attacker needs a way to provide or induce the victim to open the malicious Markdown content, and the victim must perform the link click.

Avoid passing untrusted link targets to shell-evaluated commands. Use direct process APIs with separated arguments, strict scheme validation, and explicit handling for unsupported targets.

Treat all Markdown-controlled links as untrusted, test platform-specific link handlers with shell metacharacters, enforce secure process-spawning policies, and apply least privilege to development tools.

Find out what's already
exploitable in your codebase.