Project Zero: a .NET AnyCPU file slips past VirtualBox checks
In short
- What it is: Google Project Zero researcher James Forshaw found that a .NET program compiled as "AnyCPU" slips past the check VirtualBox uses on Windows to decide which DLL files (code libraries) may load into its protected virtual-machine processes. The file is not altered. The bug is CVE-2026-87268.
- How it works: VirtualBox's check wrongly answers "this file has the wrong format", and the .NET Framework (version 4) reacts by loading the file as plain data and running it from memory, a path the check never sees.
- Wider reach: the same .NET behaviour let a one-bit edit load untrusted code on Windows 11 S Mode with user-mode code integrity on, and in Protected Process Light processes. Microsoft fixed the S Mode case in October 2026 as CVE-2026-108398.
- Catch: these are the author's own findings. The post says the fix for protected processes was not expected to change, so that case should still work.
3 new protected-process bypasses found in VirtualBox; 1 broken fix for a 2020 bypass; 1 bit the edit that beat Windows code integrity; < 1 month from report to Microsoft's fix
What is VirtualBox process hardening?
Oracle's VirtualBox runs virtual machines on Windows. Its processes are protected from the logged-in user: the post says the mechanism gates who can open the kernel driver, which could otherwise allow privilege escalation. To keep other code out, VirtualBox hooks the Windows DLL loader (it intercepts the system calls that load libraries) and refuses files that fail its trust checks.
Forshaw first studied this in 2017 and found 3 ways round it, plus a COM issue in 2020. In 2026 he looked again and found 3 new bypasses for protected processes, plus a broken fix for the 2020 bypass that stopped working because Windows changed. The post covers one of them.
How can a .NET assembly bypass the check?
The post's chain has three links.
1. .NET has a second way to load a file. The .NET Framework can load an assembly (a .NET DLL of managed code) from a memory buffer. Inside the runtime, the function that maps an assembly first tries to map the file as an image section, which tells Windows "this is an executable". If that fails with the error ERROR_BAD_EXE_FORMAT, it falls back to mapping the file as a flat, data-only section, then checks that the file is a valid PE (Windows executable format) file. Data-only mappings have no executable pages, which does not matter for managed code. So if the first step is made to fail with that specific error, the assembly runs and any protection watching image loads never sees it.
2. VirtualBox's hook can produce exactly that error. The hook on NtCreateSection (the system call underneath file mapping) screens only requests for images or executable memory. The flat mapping asks for neither, so it is not checked. But when the hook rejects an image because its architecture does not match the host while it still contains executable sections, VirtualBox returns STATUS_INVALID_IMAGE_FORMAT, which Windows reports as ERROR_BAD_EXE_FORMAT.
3. AnyCPU produces such a file. A managed .NET assembly compiled as AnyCPU is written as a 32-bit x86 PE file so it runs anywhere. On a 64-bit host that is an architecture mismatch, yet the file has executable code (the post's dumpbin output shows a "size of code" of 35CC00). Compiling any assembly as AnyCPU therefore triggers the error with no file editing, and the file stays a valid assembly.
To get the file loaded, the post uses COM hijacking: register a .NET COM class in the current user's registry hive for a class a hardened VirtualBox process loads, then start a VM. The post says a full proof of concept is in the issue tracker.
Our wording: think of a guard who checks every sealed envelope, but waves through any parcel whose label says "wrong size, open it at the side desk". Here, the side desk runs the contents.
VirtualBox fixed it by never returning STATUS_INVALID_IMAGE_FORMAT from that status-mapping function. It also added code making COM hijacking harder, using an undocumented COM option that turns off current-user registry lookups.
Does the trick work against Windows itself?
The post asks whether the .NET behaviour affects Windows' own code integrity, which Windows Defender Application Control (WDAC) and protected processes rely on. With no user-mode hook to abuse, Forshaw needed a way to make NtCreateSection return that status for a file .NET still accepts. Clearing one flag, IMAGE_FILE_EXECUTABLE_IMAGE, in the file's header did it: Windows refuses to map it as an image, .NET ignores the flag. He says no other fix-ups, not even the checksum, are needed.
A check in the runtime should stop this when code integrity is enforced, but it did not on Windows 11 S Mode. The post says the check compared the lockdown-policy flags against one exact value, and that value is what Windows 11 S Mode returns, so the check passed and user-mode code integrity enforcement (UMCI) was bypassed. The Dynamic Code Security option would block the attack, but it is not on by default and breaks in-memory loading generally.
For a default Windows install, the check does not apply to protected processes at all. Forshaw says only Protected Process Light (PPL) is exposed, since the older Protected Process needs page hashes in DLL signatures that the .NET runtime DLLs lack. By hijacking a COM object that WerSecureFault.exe loads, he got arbitrary code as PPL at the TCB level without administrator rights.
Reporting and fix
2017: Forshaw's first VirtualBox hardening research finds 3 bypasses. Sept 2026: After developers say the check should hold, he reports the S Mode issue to Microsoft; he had already shown it at the 44Con conference. Oct 2026: Microsoft fixes it as CVE-2026-108398, less than a month after the report, treating it as a zero day because it was already public. 23 Nov 2026: Project Zero publishes the post.
Forshaw first judged the issue out of scope: Microsoft's servicing criteria exclude PPL bypasses, and he read the WDAC goal as allowing a policy to block it. .NET developers told him the Dynamic Code Policy blocked it only by accident. The fixed check uses WLDP_LOCKDOWN_IS_ENFORCE to test for UMCI. The post says this does not change PPL, which therefore should still be bypassable. His lesson: where expected behaviour is unclear, "a real issue might not get reported".
What is not stated
- The post gives no exploitation in the wild and no VirtualBox version numbers, so we cannot say which releases are fixed.
- The trick works on .NET Framework v4 only. In v3.5 and v2 the file still fails to load later on, and the post did not investigate modern .NET (v5 and above).
- We did not test the proof of concept, and did not check Microsoft's advisory.
Terms in plain English
- Process hardening: extra rules that keep other code out of a sensitive program (our wording).
- DLL: a library file of code a program loads while it runs (our wording).
- Image section: how Windows maps a file as executable code, so security checks can inspect it (our wording).
- WDAC / UMCI: Windows policy that limits which programs and libraries may run; UMCI is its user-mode part.
- Protected Process Light (PPL): a Windows protection level that shields system processes from ordinary users.
Sources
- VirtualBox Process Hardening on Windows 2026 Edition: What's a Single Bit Between Friends?, Google Project Zero (James Forshaw), 23 November 2026
Sources
Related stories
- Project Zero cuts bug disclosure deadline to 30 days by 2028
- Chrome AI bug finder and fuzzer near tie: 45 vs 37, 25% shared
- Why urgent security patches are slow, and four ways to speed them
- Cloudflare brings full post-quantum switch forward to 2027
- Anthropic says plain Claude Code review finds 11 of 21 logic bugs
- OpenSSL fixes Encrypted Client Hello bug allowing impersonation
More from Vulnerability Research
- Anthropic cuts its bug-disclosure deadline from 90 to 30 days
- eMudhra's eight CA keys were guessable; one was just the number 4
- Trail of Bits: only 2 of 25 package managers verify every package
- OpenSSL fixes a DTLS bug that can leak heap memory to a peer
- Unzeroed disk blocks let Cloudflare Containers leak old data