/

CVE-2026-48778

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) via Notepad++ config.xml

CVE-2026-48778

Analyzed

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

Notepad++ prior to 8.9.6.1 reads the commandLineInterpreter value from config.xml and uses it as an executable path without validation.

If an attacker can modify this configuration file, they can cause Notepad++ to run arbitrary commands when the user invokes "Open Containing Folder → cmd".

Affected context

This vulnerability appears in Notepad++ installations where the config.xml file is writable or replaceable by an attacker or untrusted process.

The issue is triggered when the GUI uses the commandLineInterpreter value to launch a shell via the "Open Containing Folder → cmd" feature.

It is most relevant in environments where user profiles or application configuration directories are not strongly protected, such as multi-user systems or those exposed to malware that can tamper with local configuration files.

Exploit preconditions

  • Attack surface: Local desktop application behavior (Notepad++ GUI action).
  • Required access: Ability to modify or replace the config.xml file in the Notepad++ configuration directory.
  • Trigger point: User selects "File → Open Containing Folder → cmd" (IDM_FILE_OPEN_CMD), causing Notepad++ to read the commandLineInterpreter value and pass it into ShellExecute.
  • Why exploitation is possible: The application trusts the commandLineInterpreter XML tag as a safe executable path without validation, whitelisting, or authenticity checks, allowing arbitrary executables or commands to be invoked.

Why this happens

At a design level, Notepad++ treats configuration data as implicitly trusted and directly uses it to determine which executable to run.

The commandLineInterpreter tag in config.xml is read via NppXml::value() and stored in _nppGUI._commandLineInterpreter with no input validation, origin checking, or digital signature verification.

Later, a Command object is constructed with this value and ShellExecute is called, effectively delegating process creation to attacker-controlled data.

This matches CWE-78: OS Command Injection, where external input influences command execution parameters without restriction, leading to arbitrary command execution under the user's privileges.

Potential impact

  • An attacker may cause Notepad++ to launch arbitrary executables instead of a legitimate command-line interpreter.
  • Malicious software could use the configuration to persist and execute on user interaction.
  • Local users or malware could escalate from configuration tampering to full application compromise.
  • System integrity and user data could be impacted by commands running with the user's permissions.

General mitigation guidance

Effective mitigation patterns focus on ensuring that executable paths and command interpreters are not derived from untrusted configuration data.

Common strategies include:

  • Restricting configurable command interpreter options to a vetted, internal whitelist rather than arbitrary values.
  • Applying strict validation to any path or command read from configuration, ensuring it matches expected patterns and locations.
  • Treating configuration files as sensitive assets by enforcing appropriate filesystem permissions and ownership to reduce tampering.
  • Designing GUI actions so they rely on built-in system APIs or fixed commands instead of user-editable values.
  • Applying the principle of least privilege to launched processes and avoiding execution of binaries from untrusted directories.

How teams detect issues like this

Detection efforts can center on configuration and code paths that influence process creation:

  • Static analysis rules that flag direct use of configuration-derived strings in process-launch APIs such as ShellExecute, CreateProcess, or equivalent.
  • Targeted code reviews for features that read values from XML or other config formats and then use them as executable paths or command arguments.
  • Policies that require whitelisting and input validation for any configurable command interpreter or external tool integration.
  • Endpoint monitoring to observe unexpected executables being launched by Notepad++ or similar applications, potentially indicating malicious configuration changes.

Sources

SourceLink
github.comgithub.com/notepad-plus-plus/notepad-plus-plus/commit/24c7b5c63cece76dbc8c4f2607a27ebfe22fa614
github.comgithub.com/notepad-plus-plus/notepad-plus-plus/security/advisories/GHSA-7hm3-wp5q-ccv9

Frequently asked

questions

Not directly in isolation. Exploitation normally requires local access or malware capable of modifying Notepad++'s config.xml, followed by a user triggering the vulnerable command.

An attacker needs the ability to write to or replace the Notepad++ configuration file in the user's profile or installation directory. This can occur through local user access, compromised accounts, or malicious software operating with the user's permissions.

The safest approach is to decouple command execution from untrusted configuration data: use a fixed, internally defined command interpreter or a strict whitelist, and validate any configuration values before they influence process creation APIs.

During design and implementation, treat configuration inputs as potentially untrusted, enforce strong validation and whitelisting for anything that affects command execution or process control, and include automated checks in CI pipelines to flag uses of external input in OS command APIs.

Find out what's already
exploitable in your codebase.