BlueHammer: When Your Antivirus Becomes the Attacker’s Way In
A time-of-check to time-of-use race condition in Windows Defender's threat remediation engine allowed an attacker to redirect a privileged cleanup operation to a different target. This let an unprivileged attacker gain SYSTEM-level code execution and an arbitrary read handle to the SAM database.
medium.com
Published on medium.com
Imagine a bank vault where the guard checks your ID, confirms you’re allowed inside, and then turns to unlock the door. In that half-second gap between “checked” and "unlocked", someone swaps places with you.
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 race condition in Defender's remediation engine, where the file checked is not the same as the file acted on because the operation is not atomic.
Impact
An unprivileged local attacker could escalate to SYSTEM-level code execution and gain an arbitrary read handle to the SAM database; the text notes the flaw was actively exploited by ransomware groups months after a patch was available.
What the attacker needed
Local access to a Windows machine; unprivileged user account; Defender real-time protection enabled
The fix
Microsoft shipped a patch on April 14, 2026 that closes the timing gap so the check and use happen as one atomic step.
How it was found
- Place a file on disk that Defender will detect as malicious.
- Defender checks the file and starts its privileged cleanup process.
- Use filesystem tricks to briefly delay Defender between its check and its action.
- During that pause, redirect what Defender is about to act on.
- Defender acts on the attacker's chosen target with high privileges, leading to SYSTEM access.
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 the built-in antivirus on Windows. When it finds a bad file, it checks which file it is and then deletes or quarantines it. This bug is a tiny gap between the check and the delete: an attacker can swap the file in that gap so Defender deletes something else with high privileges, letting the attacker take full control of the computer.
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.