Critical Notepad Flaw in Windows Allows Remote Code Execution via Markdown Files; Update Urgently

Critical Windows Notepad Vulnerability Exposes Users to Remote Code Execution

Microsoft has recently addressed a significant security flaw in the modern Windows Notepad application, identified as CVE-2026-20841. This vulnerability, rooted in command injection, allows attackers to execute arbitrary commands on a victim’s system by exploiting the application’s handling of Markdown files.

Discovery and Analysis

The vulnerability was initially discovered by security researchers Cristian Papa and Alasdair Gorniak from Delta Obscura. Their findings were further analyzed by Nikolai Skliarenko and Yazhi Wang of the TrendAI Research team. The flaw resides in the modern Windows Notepad app, distinct from the legacy Notepad.exe, which supports Markdown rendering for files with the `.md` extension. When such a file is opened, Notepad processes its contents and renders links interactively.

The specific function responsible for handling these links, `sub_140170F60()`, passes the link value to the Windows API call `ShellExecuteExW()` after minimal filtering. This insufficient filtering fails to block malicious protocol URIs like `file://` and `ms-appinstaller://`, which can be exploited to load and execute remote or local attacker-controlled files without triggering standard Windows security warnings.

Exploitation Methodology

To exploit this vulnerability, an attacker would craft a malicious Markdown file containing a hyperlink that utilizes a vulnerable protocol. The attacker then delivers this file to the target through email, a download link, or other social engineering tactics. Upon opening the file in Notepad and clicking the malicious link, the application processes it without adequate verification, leading to the execution of arbitrary commands in the context of the user’s account.

It’s important to note that `.md` files are not associated with Notepad by default. However, users who manually open them in Notepad trigger the Markdown rendering, making the vulnerability exploitable. A public proof-of-concept demonstrating this exploit has been made available on GitHub, highlighting the ease with which this vulnerability can be leveraged.

Affected Versions and Patch Details

The vulnerability affects Notepad versions 11.2508 and earlier. Microsoft has released a fix through the Microsoft Store in build 11.2510 and later. The legacy Notepad.exe is not impacted by this issue. Microsoft has not provided any workarounds and emphasizes that user interaction is required for exploitation. Therefore, it is crucial for organizations and individual users to ensure that automatic updates are enabled in the Microsoft Store and to verify that their Notepad application is updated to the latest version to mitigate this risk.

Security Implications

This vulnerability underscores the importance of rigorous input validation and protocol handling in applications that process user-generated content. The ability to execute arbitrary commands through a simple hyperlink in a Markdown file poses a significant security risk, especially considering the widespread use of Notepad for viewing and editing text files.

Users are advised to exercise caution when opening Markdown files from untrusted sources and to avoid clicking on links within such files unless they are certain of their safety. Additionally, maintaining up-to-date software and enabling automatic updates are essential practices to protect against known vulnerabilities.

Conclusion

The prompt identification and patching of CVE-2026-20841 by Microsoft highlight the ongoing challenges in securing widely used applications against emerging threats. Users and organizations must remain vigilant, apply updates promptly, and adhere to best practices in cybersecurity to safeguard their systems against potential exploits.