Notepad++ - CVE-2025-49144
CVE-2025-49144
Description
Notepad++ is a free and open-source source code editor. In versions 8.8.1 and prior, a privilege escalation vulnerability exists in the Notepad++ v8.8.1 installer that allows unprivileged users to gain SYSTEM-level privileges through insecure executable search paths. An attacker could use social engineering or clickjacking to trick users into downloading both the legitimate installer and a malicious executable to the same directory (typically Downloads folder - which is known as Vulnerable directory). Upon running the installer, the attack executes automatically with SYSTEM privileges. This issue has been fixed and will be released in version 8.8.2.
Source: https://nvd.nist.gov/vuln/detail/CVE-2025-49144
I used a simple file creation, but this works with any msfvenom, silver shellcode.
Summary:
The vulnerability stems from how the installer checks for the regsvr32. During Dynamic Analysis I've found that it first tries to find it in the working directory of the installer, meaning that the PATH is not quoted, thus not absolute.
Static Analysis
Every vulnerability hunt begins with a hypothesis. Based on the description of the CVE and given the fact that installers run with elevated privileges, I wanted to see what kernel32.dll are called by the installer or any other WinAPI calls.

Upon analyzing more functions, I found myself in a rabbithole and I came to the conclusion that this might be a NSIS unpacker.
This was one of the things that made me think of that strongly:
On top of that, the entryfunction confirmed my hunch:
The following calls made it clearer:
GetTempPathW(...)wsprintfW(..., u_~nsu%X.tmp_0040a314, ...)SetCurrentDirectoryW((LPCWSTR)&DAT_00436800)CopyFileW(...)
Upon digging more into some functions: HWND FUN_00401434(HWND param_1), I noticed that this is a big switch-case block. Interesting stuff I found at 0x28:

After this wrapper call we can see several Reg calls:

There are many Reg Calls after the Shell Direct API Call, meaning that somewhere in between regsvr32.exe is called. I tried filtering for string, but we can't find a PATH directly.

Going deeper:
I am still a beginner in RE and static, so I decided to move to ProcMon and confirm my hunches.
Dynamic Analysis
Turned on ProcMon and started investigating.
Filtering out the npp installer, didn't take me too long to see such a gem (from an attacker perspective):
Voila! The installer tried to find regsvr32.exe first in the directory file! Meaning that the PATH is unquoted, thus not absolute!
To further confirm my initial hunch, I decided to check what's going on in the Temp directory:

Writing the PoC
I decided to simply write a .cs file:
Then convert it into shellcode with donut, storing it in a header file.
Wrote a small C code to load that shellcode in memory:
Compiled it as regsvr32.exe and stored it in the same folder with the installer.
PoC Video
Last updated