<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Maverick Doan on Medium]]></title>
        <description><![CDATA[Stories by Maverick Doan on Medium]]></description>
        <link>https://medium.com/@maverickdoan?source=rss-ba1cb5beb1ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wf5MY3hzt756_ZPu-sVCDw.jpeg</url>
            <title>Stories by Maverick Doan on Medium</title>
            <link>https://medium.com/@maverickdoan?source=rss-ba1cb5beb1ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 16:11:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@maverickdoan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Same CWE, Different Vector: RCE in Notepad++ Uninstaller (CVE-2025–49144)]]></title>
            <link>https://medium.com/@maverickdoan/same-cwe-different-vector-rce-in-notepad-uninstaller-71f17e343b5b?source=rss-ba1cb5beb1ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/71f17e343b5b</guid>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Maverick Doan]]></dc:creator>
            <pubDate>Wed, 09 Jul 2025 04:40:01 GMT</pubDate>
            <atom:updated>2025-12-07T05:33:09.962Z</atom:updated>
            <content:encoded><![CDATA[<h3>Same CVE, Different Vector: RCE in Notepad++ Uninstaller (CVE-2025 -49144)</h3><blockquote><em>“Sometimes it’s darkest under the candle.”</em> — @xomx, review comment</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lb0hIAS1fttcxdQP3kwmsw.jpeg" /></figure><p>Recently, I discovered a vulnerability in the Notepad++ uninstaller that allows arbitrary code execution (RCE) through a classic “uncontrolled search path element” attack. This vulnerability, classified as CWE-427, occurs when applications call system binaries without specifying their full path, relying on Windows’ executable search order instead.</p><p>While the Notepad++ team had already patched this issue in their installer (CVE-2025–49144), the uninstaller remained vulnerable.</p><h3>1. Why look at the uninstaller?</h3><pre>- ExecWait &#39;regsvr32 /u /s &quot;$INSTDIR\nppcm.dll&quot;&#39;<br>+ ExecWait &#39;&quot;$winSysDir\regsvr32.exe&quot; /u /s &quot;$INSTDIR\nppcm.dll&quot;&#39;</pre><p><strong>CVE-2025–49144</strong> showed that <strong>Notepad++’s</strong> <strong>installer</strong> could be hijacked by dropping a fake <strong>regsvr32.exe </strong>or <strong>rundll32.exe </strong>beside <strong>npp.X.Y.Installer.exe </strong>in <strong><em>Downloads</em></strong>. A quick code review suggested the <em>exact same pattern</em> lived in the uninstallation script at <strong><em>PowerEditor/installer/nsisInclude/uninstall.nsh.</em></strong></p><h3>2. NSIS Uninstaller Behaviour</h3><figure><img alt="C:\Program Files\Notepad++\uninstall.exe (File Explorer)" src="https://cdn-images-1.medium.com/max/913/1*3ImXt2QZfMGtq3lbu_23Gg.png" /></figure><p>NSIS uninstallers have a more sophisticated execution model. Unlike the installer, Notepad++ uninstaller does not run from <strong><em>C:\Program Files\Notepad++\ </em></strong>where it resides but instead self-extracts to a temporary folder at <strong><em>%TEMP%\~nsu*.tmp</em></strong><em>, </em>and then a copy is executed from there.</p><figure><img alt="Procmon Inspection of Notepad++ Uninstaller self-extraction" src="https://cdn-images-1.medium.com/max/679/1*8hG2CR4Y9qdf0QJYXtcDsw.png" /></figure><p>The actual uninstaller process runs as <strong>Un.exe</strong> from a temporary directory. All child processes spawned by the uninstaller inherit this temporary directory as their working directory, confirmed using Process Monitor (Procmon), which showed the actual uninstaller process as above.</p><h3>3. Windows Process Search Order</h3><h4><strong><em>ExecWait </em></strong><em>and </em><strong><em>CreateProcess</em></strong></h4><pre># Uninstaller (uninstall.nsh) source code snippet before patching<br>Section un.explorerContextMenu<br> ExecWait &#39;regsvr32 /u /s &quot;$INSTDIR\NppShell_01.dll&quot;&#39;<br> ExecWait &#39;regsvr32 /u /s &quot;$INSTDIR\NppShell_02.dll&quot;&#39;<br> ExecWait &#39;regsvr32 /u /s &quot;$INSTDIR\NppShell_03.dll&quot;&#39;<br> ExecWait &#39;regsvr32 /u /s &quot;$INSTDIR\NppShell_04.dll&quot;&#39;<br> ExecWait &#39;regsvr32 /u /s &quot;$INSTDIR\NppShell_05.dll&quot;&#39;<br> ExecWait &#39;regsvr32 /u /s &quot;$INSTDIR\NppShell_06.dll&quot;&#39;</pre><p>NSIS’s <strong>ExecWait</strong> command is essentially a <strong>wrapper </strong>around the Windows API <strong>CreateProcess</strong>. When <strong>CreateProcess</strong> is called without a full path to the executable, Windows follows a search order to locate the binary:</p><ul><li>The directory from which the application loaded</li><li>The current working directory</li><li>The system directory</li></ul><p>…</p><ul><li>PATH environment variables</li></ul><p>In the case of the Notepad++ uninstaller, the application is loaded from <strong><em>%TEMP%\~nsu*.tmp\Un.exe</em></strong>. The current working directory is <strong><em>%TEMP%\~nsu*.tmp</em></strong>. When <strong>ExecWait “regsvr32 …” </strong>or <strong>ExecWait “rundll32 …” </strong>is called, Windows first searches in <strong><em>%TEMP%\~nsu*.tmp</em></strong>.</p><h4>Exploitation Vector</h4><p>If an attacker can place a malicious <strong>regsvr32.exe</strong> or <strong>rundll32.exe</strong> in the <strong><em>%TEMP%\~nsu*.tmp</em></strong> directory before the uninstaller calls these binaries, Windows will execute the malicious binary instead of the legitimate system binary.</p><p>The key insight is that the uninstaller’s working directory is predictable (following the ~nsu*.tmp pattern) and is created at runtime, providing a window of opportunity for exploitation.</p><h3>4. Proof of Concept Walkthrough</h3><h4>Build a Quick Test Binary</h4><p>I developed a nice and quick PoC binary in Go that would provide clear evidence of a successful exploitation. GitHub: <a href="https://github.com/maverick-doan/win-rce-checker/blob/main/vulCheck.go">github.com/maverick-doan/win-rce-checker</a>.</p><pre>// Main script<br>package main<br><br>import (<br> &quot;fmt&quot;<br> &quot;os&quot;<br> fileOps &quot;win-rce-checker/pkg/file-ops&quot;<br> procOps &quot;win-rce-checker/pkg/proc-ops&quot;<br>)<br><br>var (<br> path    string = &quot;C:\\Users\\Public\\exploit_success.txt&quot;<br> content string = &quot;Exploited&quot;<br> cmd     string = &quot;calc.exe&quot;<br>)<br><br>func main() {<br> // Ignore any commandline arguments<br> _ = os.Args<br><br> // Evidence file<br> file, err := fileOps.WriteIndicatorFile(path, content)<br> if err != nil {<br>  fmt.Println(&quot;Error:&quot;, err)<br>  return<br> }<br> defer file.Close()<br><br> fmt.Println(&quot;Evidence file written.&quot;)<br><br> // Evidence command execution<br> err = procOps.ExecuteIndicatorCmd(cmd)<br> if err != nil {<br>  fmt.Println(fmt.Sprintf(&quot;Command execution for \&quot;%s\&quot; failed:&quot;, cmd), err)<br> } else {<br>  fmt.Printf(&quot;Command \&quot;%s\&quot; executed.&quot;, cmd)<br> }<br>}</pre><h4>Testing Methodology</h4><ul><li>Monitor the uninstaller process to identify the temporary directory being used</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*ehsOCiXOEucLWCj-W68CeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*abI2NvxUnuuI2GXp2xYHTg.png" /></figure><ul><li>Place and renamed as <strong>regsvr32.exe</strong> into the identified temp directory</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*pvaChYGt1MDTAoWfRylmDw.png" /></figure><ul><li>Trigger the uninstaller and observe if the malicious binary is executed</li></ul><p>The testing confirmed that when a malicious <strong>regsvr32.exe</strong> or <strong>rundll32.exe </strong>is placed in the <strong>~nsu*.tmp</strong> directory, it gets executed during the uninstallation process, indicating a successful exploitation of the vulnerability.</p><h4>The Fix</h4><p>The solution was straightforward: update all system binary calls in the uninstaller to use the full path, matching the approach already implemented in the installer. GitHub Patch: <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/pull/16788/commits/8144cd5f3b6d5baf9b16237666f5148b2a921092">github.com/notepad-plus-plus/notepad-plus-plus</a>.</p><pre>- ExecWait &#39;regsvr32 /u /s &quot;$INSTDIR\NppShell_01.dll&quot;&#39;<br>+ ExecWait &#39;&quot;$winSysDir\regsvr32.exe&quot; /u /s &quot;$INSTDIR\NppShell_01.dll&quot;&#39;<br><br>- ExecWait &#39;rundll32.exe &quot;$INSTDIR\contextmenu\NppShell.dll&quot;,CleanupDll&#39;<br>+ ExecWait &#39;&quot;$winSysDir\rundll32.exe&quot; &quot;$INSTDIR\contextmenu\NppShell.dll&quot;,CleanupDll&#39;</pre><p>This ensures that only the legitimate system binaries are executed, regardless of what files might be present in the working directory.</p><figure><img alt="GitHub Pull Request Details" src="https://cdn-images-1.medium.com/max/1024/1*ZRsrTe9gTJu_W3RN8Pi2kQ.png" /></figure><h3>5. Impact and Severity</h3><p>While this vulnerability allows for arbitrary code execution, the practical impact is limited by the requirement for the right privilege to write to the temporary directory. However, it still represents a significant security issue due to:</p><ol><li>Defence in Depth: It violates the principle of not trusting the execution environment.</li><li>Privilege Escalation Potential: If directory permissions are ever weakened, this could become a privilege escalation vector</li><li>Code Hygiene: It’s a best practice to specify full paths for system binaries</li></ol><h3>6. Conclusion</h3><p>This <strong>CWE-427</strong> vulnerability in the <strong>Notepad++ uninstaller</strong> is direct sibling of the previously patched <strong>CVE-2025–49144</strong>, and the discovery process demonstrates how minor oversights in code can carry on further security implications. From a <strong>development perspective</strong>, this highlights the importance of explicitly qualifying every external command. From a <strong>maintenance perspective</strong>, re-auditing what you have “fixed last week” is never redundant. And from a <strong>security researching perspective</strong>, it reinforces the value of having a deep understanding of software internals and platform-specific behaviours, such as how Windows handles process creation or how NSIS manages uninstallation, in uncovering bugs that might otherwise go unnoticed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71f17e343b5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>