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.xmlfile in the Notepad++ configuration directory. - Trigger point: User selects "File → Open Containing Folder → cmd" (IDM_FILE_OPEN_CMD), causing Notepad++ to read the
commandLineInterpretervalue and pass it intoShellExecute. - Why exploitation is possible: The application trusts the
commandLineInterpreterXML 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.

