CVE-2026–20841 Tracing an RCE From Patch Diff to Root Cause
A race condition in Windows Internal Library telemetry code allowed corruption of a feature usage cache, bypassing Notepad's protocol handler validation. An attacker could craft a malicious markdown file that, when opened, executes arbitrary code via dangerous protocol handlers such as ms-msdt://.
medium.com
Published on medium.com
A race condition in Windows Internal Library (WIL) telemetry code allows attackers to bypass Notepad’s protocol handler validation. By corrupting feature usage tracking, malicious markdown files can execute arbitrary code through dangerous Windows protocol handlers like ms-msdt://.
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 a race condition in the telemetry cache update: the return structure was written unconditionally outside the atomic compare-and-swap loop, allowing concurrent threads to corrupt the validation flag.
Impact
An attacker could execute arbitrary code by convincing a user to open a malicious markdown file in Notepad, but the exploit requires winning a race condition and may depend on the availability of dangerous protocol handlers.
What the attacker needed
Victim opens a malicious markdown file; race condition must be won; dangerous protocol handler available
The fix
The patch makes the state updates conditional, only writing when the protocol was not previously cached, preventing the race.
How it was found
- Obtain vulnerable and patched notepad.exe versions.
- Use Diaphora to diff the binaries and identify the patched function wil_detailsFeatureReporting_RecordUsageInCache.
- Analyse the patch diff to see the condition flip and new conditional block.
- Trace callers via cross-references to ReportUsageToService and then to the command handler sub_140008DF0.
- Identify that ShellExecuteW is called for markdown link clicks after telemetry recording.
- Craft a markdown file with multiple links to race the validation cache and include a dangerous protocol handler.
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 can open links in markdown files, and before opening a link it checks whether the link's protocol (like http or ms-msdt) is safe. That check used a shared cache that could be corrupted if two links were processed at the same time, so a dangerous protocol could be treated as already validated. An attacker could then include a malicious link in a markdown file that runs code when clicked.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.