Executive brief
Notepad++, a widely-used source code editor, contains a stack buffer overflow vulnerability in how it handles session file paths. An attacker can provide an overly long settings directory path via the -settingsDir command-line argument, causing the application to crash with a denial of service when it attempts to save the session. The protected build's stack canary prevents code execution, but the crash prevents legitimate use.
Technical details
The vulnerability exists in NppParameters::writeSession in PowerEditor/src/Parameters.cpp, where user-controlled session paths derived from the -settingsDir command-line parameter are copied into a fixed-size stack buffer (backupPathName[MAX_PATH]) using unbounded wcscpy and wcscat functions. A sufficiently long settings directory path causes the SESSION_BACKUP_EXT suffix to overflow the buffer, triggering a stack canary check in protected builds and terminating the process. The fix, applied in version 8.9.8, uses bounded string functions to prevent the overflow.
Affected products
- Notepad++ Notepad++ before 8.9.8
Timeline
- 2026-09-22: disclosed
- 2026-08-23: patched: version 8.9.8 released