Skip to content
Path traversal Write-up Intermediate

Notepad++ Zero-Click RCE via Path Traversal (CVE-2026-52884)

The patch for CVE-2026-48800 added a trusted-directory check that does not canonicalise paths, so a path traversal after a trusted prefix bypasses it. An attacker who can modify shortcuts.xml can execute arbitrary programs without a warning dialog.

github.com

Published on github.com

The CVE-2026-48800 patch adds isInTrustedDirectory() validation in Command::run() (RunDlg.cpp) before calling ShellExecute(). This function checks whether the resolved executable path is under a trusted directory:

The author, on github.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the trusted-directory check compares the raw path string against trusted prefixes without first resolving '..' components, so a path that starts with a trusted directory but traverses elsewhere passes the check.

Impact

An attacker who can write to shortcuts.xml (directly, via a malicious .lnk with -settingsDir=, or through cloud sync) could execute arbitrary code without user confirmation, but this requires local access or the ability to modify the configuration.

What the attacker needed

Ability to modify shortcuts.xml; or ability to supply a malicious -settingsDir=; or control over cloud-synced config

The fix

The path should be canonicalised with PathCanonicalize() or GetFullPathNameW() before checking it against trusted directories.

How it was found

  1. Create or modify shortcuts.xml to include a command whose executable path starts with a trusted directory followed by '..\..\' and then the real path to an untrusted executable.
  2. Save the file in %APPDATA%\Notepad++\shortcuts.xml.
  3. Open Notepad++ and trigger the command (e.g., press Alt+F1 or use the Run menu).
  4. The executable runs without any security warning dialog.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Notepad++ lets you define custom commands that run programs. A previous fix tried to block dangerous programs by checking if they live in trusted folders like Windows. This report shows that check can be fooled by adding '..' to the path, which means 'go up one folder', so the program actually runs from somewhere else. If an attacker can change your shortcuts file, they can run any program without you seeing a warning.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.