/

CVE-2026-48800

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) via Notepad++ Run Menu

CVE-2026-48800

Modified

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution on User System

Severity:

HIGH RISK

(7.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

A command injection flaw in Notepad++ allows attacker-controlled entries in shortcuts.xml to be executed directly via the Run menu without validation.

If an attacker can modify the <Command> tag within <UserDefinedCommands>, they can run arbitrary executables or scripts when the user triggers the corresponding menu item, enabling stealthy persistence on the system.

Affected context

This vulnerability occurs when Notepad++ loads user-defined commands from the shortcuts.xml configuration file and exposes them through the Run menu.

It is relevant in environments where shortcuts.xml can be modified by local users, malware, or other processes, and where Notepad++ is routinely used with the Run menu.

The risk is higher on systems where the application is executed with elevated or highly trusted user privileges and configuration files are not integrity-protected.

Exploit preconditions

  • Attack surface: Local desktop environment via Notepad++ configuration (shortcuts.xml)
  • Required access: Ability to write or tamper with the <UserDefinedCommands> section, specifically the <Command> tag text in shortcuts.xml
  • Trigger point: A user clicks the crafted Run menu entry or otherwise invokes the associated user-defined command from within Notepad++
  • Why exploitation is possible: Notepad++ reads the command text from XML and passes it directly to ShellExecute without validation, sanitization, or restriction, allowing arbitrary command execution.

Why this happens

The root cause maps to CWE-78 (OS Command Injection): user-controlled input is passed as a command or executable path to an operating system launcher API without sufficient validation or constraints.

Notepad++ parses the <Command> text from shortcuts.xml into UserCommand._cmd and later calls ShellExecute on this value, implicitly trusting configuration content as safe commands.

This design treats external configuration as trusted instructions, failing to restrict allowable paths, arguments, or execution targets, which enables arbitrary OS-level command execution when a malicious entry is clicked.

Potential impact

  • Malicious commands may be executed in the context of the Notepad++ user.
  • Attackers could establish persistence via benign-looking Run menu items.
  • Local malware or adversaries could launch further payloads or tools silently.
  • Sensitive data could be exfiltrated or modified by executed scripts or binaries.
  • System integrity can be degraded if commands are run with elevated privileges.

General mitigation guidance

Effective mitigation focuses on reducing trust in configuration-driven commands and restricting what can be executed from within the application.

Pattern-based approaches include:

  • Constraining Run menu entries to a curated set of allowed executables or command templates, rather than arbitrary strings from configuration.
  • Validating and normalizing command paths from shortcuts.xml, rejecting entries that include unexpected arguments, special characters, or non-whitelisted locations.
  • Treating configuration files as untrusted input by applying strict parsing rules, schema validation, and limiting the scope of what user-defined commands can do.
  • Reducing the privileges under which Notepad++ runs, so that any executed commands inherit a low-privilege context.
  • Providing secure-by-default settings that disable or limit user-defined commands unless explicitly enabled in a controlled manner.

How teams detect issues like this

High-level detection can rely on a mix of configuration review and behavioral analysis:

  • Static analysis or configuration scanners that flag applications passing configuration-derived strings into ShellExecute or similar OS command APIs.
  • Code review practices that look for direct use of OS execution functions wired to user or configuration inputs, and require validation or whitelisting layers.
  • Policy enforcement around desktop applications that restrict arbitrary command execution features, especially those sourced from easily writable configuration files.
  • Monitoring shortcuts.xml and similar files for unexpected changes, especially additions of new <UserDefinedCommands> pointing to suspicious executables or script interpreters.
  • Endpoint security tools can alert on unusual process trees where Notepad++ spawns shells, interpreters, or administrative utilities.

Sources

SourceLink
github.comgithub.com/notepad-plus-plus/notepad-plus-plus/commit/6b3dc52a9245c6d8c6287a8d6d93a30981c05feb
github.comgithub.com/notepad-plus-plus/notepad-plus-plus/security/advisories/GHSA-3x3f-3j39-pj3v

Frequently asked

questions

It is primarily a local exploitation vector. An attacker typically needs the ability to modify shortcuts.xml on the victim system, which could happen via local malware, compromised user accounts, or malicious tools that tamper with configuration files.

The attacker needs write access to the Notepad++ configuration directory or the shortcuts.xml file. The executed commands then run with the same privileges as the user running Notepad++.

The secure pattern is to avoid passing arbitrary configuration-derived strings directly into OS command execution APIs. Instead, restrict Run menu commands to validated, whitelisted executables or command templates, and enforce strict input validation on any user-defined entries.

Treat configuration and user-provided data as untrusted, especially when it influences execution behavior. Introduce validation layers, whitelists, and least-privilege execution, and make command-launch features secure-by-default by limiting or disabling fully arbitrary command execution paths.

Find out what's already
exploitable in your codebase.