Skip to content
RCE Write-up Beginner

The Dumb Editor That Got Too Smart When Feature Bloat Leads To Rce

The modern Notepad app failed to sanitise file:// URIs in Markdown links, so a crafted .md file could make a link point to a local executable. If the user held Ctrl and clicked the link and then accepted a Windows security warning, the binary would run with the user's privileges.

Sohan Kanna Follow

Published on infosecwriteups.com

For nearly 30 years, notepad.exe was the gold standard of “dumb” utilities. It was a simple Win32-backed buffer for strings.

Sohan Kanna, on infosecwriteups.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 Markdown renderer passed file:// URIs to the operating system without validating or restricting the scheme.

Impact

An attacker could run a local binary with the user's privileges, or use a network path to try to download a payload or leak NTLM hashes, but only after the user opened the file, held Ctrl and clicked, and accepted a Windows security warning.

What the attacker needed

Victim downloads a malicious .md file; victim opens it in modern Notepad; victim holds Ctrl and clicks the link; victim accepts the Windows warning

The fix

Microsoft released a patch for the Store version of Notepad; defenders should also block notepad.exe from making network connections and from spawning shells.

How it was found

  1. Create a Markdown file containing a link that uses the file:// scheme to point at a local executable.
  2. Open the .md file in the modern Notepad app.
  3. Hold Ctrl and click the rendered link.
  4. Accept the Windows security warning that appears.
  5. The executable runs with the current user's privileges.

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 is a simple text viewer, but the new version can display Markdown, a way of writing formatted text with plain characters. A link in a Markdown file can point to a file on your own computer instead of a website. The bug meant Notepad did not check this, so clicking such a link could start a program, though Windows showed a warning first.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Sohan Kanna

View all

9 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.