Skip to content
Race condition Write-up Advanced

RoguePlanet (CVE-2026–50656): I Didn’t Touch System32 — Def

A proof-of-concept exploit abuses Windows Defender's own remediation process to replace a protected system file, wermgr.exe, without the exploit ever writing to System32 directly. By swapping a fake System32 directory for a junction to the real Windows folder mid-scan, an attacker could get a SYSTEM process to delete the genuine file and write attacker-controlled code in its place, leading to a SYSTEM shell.

TC Follow

Published on medium.com

A month ago, an anonymous researcher going by NightmareEclipse dropped the RoguePlanet proof-of-concept. Plenty of articles have described what it does — but very few explain how and why it actually works.

TC, on medium.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 a time-of-check to time-of-use flaw: Defender validates and scans a file in a user-controlled temporary path, but resolves that path again later during remediation, so a junction swapped in between makes it act on the real System32.

Impact

The exploit could get a SYSTEM-level shell and the payload persists on disk across reboots, though the write-up is the author's own reconstruction of a proof-of-concept and does not state that it was tested against a fully patched, default-configured machine.

What the attacker needed

Local access as a normal user; Windows Defender real-time protection; ability to mount an ISO image

How it was found

  1. Create a workspace in the temp folder containing a fake System32 directory.
  2. Mount an ISO holding the EICAR test file and copy it into the fake System32 as wermgr.exe.
  3. Ask Defender to scan that file through its internal API.
  4. While the scan runs, point the fake System32 at the mounted ISO with a junction, then wait for Defender's temp files and repoint it elsewhere with a second junction.
  5. Freeze Defender's I/O with an oplock and overwrite its clean copy with the attacker's binary, keeping the handle open after renaming the file.
  6. Create a third junction from the temp working directory to the real Windows folder so Defender's delete and restore land on the real wermgr.exe.

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.

Windows Defender is an antivirus that runs with very high privileges, so it is allowed to change files in protected system folders that a normal user cannot touch. This exploit builds a fake copy of a protected folder in a temporary location, gets Defender to start cleaning a harmless test file there, then quietly redirects that folder to the real system folder. Defender, still believing it is cleaning the harmless file, ends up deleting and replacing a real system program with the attacker's code.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.