Skip to content
Access control Write-up Advanced

Google Researcher Shows How a Single Bit Change in .NET Files Bypassed Windows Code Integrity

A quirk in how the .NET Framework version 4 loads program files let a local attacker run untrusted code past VirtualBox's process hardening and Windows code integrity checks. The attacker could load an untrusted .NET assembly into a protected VirtualBox process or a PPL process without administrator rights.

[email protected] (The Hacker News) Follow

Published on thehackernews.com

{{media:0}}

The Hacker News, on thehackernews.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 logic error in .NET Framework 4's loading path: when image loading fails with a specific error, it falls back to loading the file from memory without applying the same integrity checks, and its policy check for UMCI can be bypassed by clearing the IMAGE_FILE_EXECUTABLE_IMAGE flag.

Impact

A local low-privilege attacker could run code inside protected VirtualBox processes and, via the .NET flaw, inside PPL processes at the highest protection level without administrator rights; the VirtualBox issue is rated 7.8 and the Windows one 8.8, but neither is a guest-to-host escape or a remote compromise.

What the attacker needed

Local access as an ordinary user; a program willing to load the assembly; Windows with .NET Framework 4; VirtualBox 7.2.16 on a Windows host (for that case)

The fix

Oracle fixed the VirtualBox flaw in September (build 7.2.18) and Microsoft fixed the Windows flaw on October 13 with per-version updates; the PPL route reportedly still works because the October fix does not change loading for protected processes.

How it was found

  1. Register a COM object in the current user's settings that a protected VirtualBox process will load.
  2. Start a virtual machine so the protected process pulls in the COM object.
  3. Use a .NET file compiled as AnyCPU so the VirtualBox check returns the error that triggers the memory-load fallback.
  4. For the Windows code-integrity bypass, clear the IMAGE_FILE_EXECUTABLE_IMAGE flag in the .NET file's header.
  5. Load the file through the .NET Framework 4 loading path in a process willing to load the assembly, such as one on Windows 11 S Mode with UMCI enabled.
  6. For the PPL route, hijack a COM object that WerSecureFault.exe loads to run test code inside a PPL process.

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 has protections that stop ordinary users from injecting code into sensitive processes. The .NET Framework, which runs certain programs, had a fallback way of loading files from memory that skipped the usual checks. By making a tiny change to a file's header, an attacker could make the normal loading fail and trigger that unchecked fallback, so their code ran inside protected processes.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by [email protected] (The Hacker News)

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.