Executive brief
Notepad++ is a popular open-source text and code editor. A security flaw in how the application validates custom commands allows an attacker to bypass safety warnings and execute malicious programs on a user's computer. If a user is tricked into loading a compromised configuration file or clicking a malicious shortcut, an attacker could gain full control over the system, leading to data theft or malware installation.
Technical details
A path traversal vulnerability exists in Notepad++ v8.9.6.1 due to the 'isInTrustedDirectory()' function failing to canonicalize file paths before validation. The function uses a prefix-based check (PathIsPrefix) to ensure commands are executed from trusted directories like C:\Windows\System32; however, an attacker can use '..\..\' sequences to point to an untrusted location while maintaining the trusted prefix. Additionally, the application lacks restrictions on using trusted binaries (like cmd.exe or powershell.exe) as launchers for arbitrary malicious arguments. An attacker can exploit this by modifying the local 'shortcuts.xml' or using the '-settingsDir' command-line argument to point to a malicious configuration. The issue is fixed in version 8.9.6.2 by implementing HMAC integrity verification for configuration files and proper path canonicalization.
Affected products
- Notepad++ Notepad++ 8.9.6.1
Timeline
- 2026-05-30: patched: HMAC verification and path validation fixes committed to repository.
- 2026-06-26: advisory: CVE-2026-52884 published.