Skip to content
Race condition Write-up Advanced

Breaking Down LegacyHive

The Windows User Profile Service (ProfSvc) resolves a user's registry hive path in a way that can be redirected between the check and the use, so a low-privileged user can make the SYSTEM service load a different user's hive. The published proof of concept only demonstrates that the wrong hive gets loaded, not full code execution.

medium.com

Published on medium.com

At the time of disclosure, the published PoC was reported to work on all currently supported Windows desktop and server versions, including fully patched systems running the latest July 2026 security updates.

Chen Aviani, 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: ProfSvc resolves the profile hive path through the Object Manager namespace and then opens it later, so the symbolic link target can be swapped in between.

Impact

The published PoC only shows that a SYSTEM service can be made to load an unintended registry hive; it does not by itself give a SYSTEM shell, though it could be chained with another flaw that trusts registry data.

What the attacker needed

Valid credentials for the victim account; ability to modify the victim's profile registry values; local access to the Windows machine

How it was found

  1. Create a temporary working directory and copy the victim user's UsrClass.dat into it.
  2. Create an Object Manager symbolic link so the profile hive path resolves to that temporary directory.
  3. Place an opportunistic lock on the copied hive file.
  4. Start a process under the victim's account with the profile-loading flag, which makes ProfSvc begin loading the profile.
  5. When the oplock breaks, replace the symbolic link so it points at the target user's profile directory.
  6. Confirm that ProfSvc loaded the target user's hive instead of the original one.

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 keeps each user's settings in files called registry hives, and a background service running with the highest system rights loads them at logon. This report shows that the service can be tricked into loading a different user's hive file, because it decides which file to open and then opens it a moment later, and that gap can be exploited. The public demo stops at proving the wrong file is loaded; it does not yet show how to turn that into running code as the system.

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.