ProbeForWrite was honest. Its caller was not.
ProbeForWrite is the kernel's user-mode pointer validator. Its body opens with a single gate: if Length is zero, return. The Windows Driver Kit headers have carried this behaviour for two decades, and every kernel programming guide written since explains it the same way. With Length=0 there is no region to inspect, because the caller is performing a sizing query and the function should not have anything to write. The validator's response to "no bytes to validate" is to skip validation. The caller's response should be to skip writes.
ExpQuerySystemInformation is the dispatcher that sits behind NtQuerySystemInformation. It calls ProbeForWrite(buffer, Length, alignment) once, near the top of its body, and then routes to a per-class handler based on the SystemInformationClass argument. For info classes 5 (SystemProcessInformation), 0x39, 0x94, 0xFC, and 0xFD (SystemProcessInformationExtension, decimal 253), that handler is ExpGetProcessInformation.
The probe returned because there was nothing to probe. The handler started.
The length check is in the code. So is the loop that follows it.
Ori Nimron's reverse-engineering of ExpGetProcessInformation in ntoskrnl.exe (Windows 11 build 26200.8328) names the shape of the bug in nine lines, simplified here for readability:
__int64 ExpGetProcessInformation(unsigned int *buffer, unsigned int length,
unsigned int *returnSize, void *unused,
int infoClass)
{
v91 = buffer; // attacker-named pointer, from NtQuerySystemInformation
if (infoClass == 252) {
v86 = v91;
} else {
v86 = NULL;
if (infoClass == 253) {
v95 = v91; // class 253 binds v95 to the attacker pointer
goto LABEL_11;
}
// class 5 path uses v81; does not touch v95
}
v95 = NULL; // class 252 falls through here, with v95 zeroed
LABEL_11:
status = STATUS_SUCCESS;
if (length < 12) {
status = STATUS_INFO_LENGTH_MISMATCH; // error is recorded
// NO return.
}
while (NextProcess) {
// ... per-process accounting ...
if (infoClass == 253) {
++*v95; // *(uint32_t*)(addr+0) += 1
v95[1] += threadCount; // *(uint32_t*)(addr+4) += per-process thread count
v95[2] += handleCount; // *(uint32_t*)(addr+8) += per-process handle count
}
NextProcess = NextProcess->Flink;
}
return status;
}
The control flow that produces CVE-2026-40369 is the boundary between line 14 and line 17. The check on length < 12 is reachable, it runs, it computes the error value, and it stores STATUS_INFO_LENGTH_MISMATCH into the slot that the function will eventually return. The function does not return. The loop below it executes with v95 pointing wherever the caller said.
For a class 253 call from usermode, that pointer is the second argument of NtQuerySystemInformation. The caller supplies 0xffff800041424344 and Length=0. ProbeForWrite returns immediately because there are no bytes to write. ExpGetProcessInformation reaches its length check, marks the failure, and proceeds into the loop. For each process on the system, the loop writes three DWORDs at the kernel address the caller named.
The basic PoC in basic_poc/basic_poc.cpp is sixty-four lines and ends with the line that does it:
NTSTATUS status = pNtQSI(
SystemProcessInformationExtension,
target, /* kernel address; ProbeForWrite skipped because Length=0 */
0, /* Length=0 bypasses ProbeForWrite entirely */
&needed
);
The kernel writes. Then it returns 0xC0000004 (STATUS_INFO_LENGTH_MISMATCH) to the caller. The caller, in usermode, sees the failure code and learns nothing it did not already know. The increment is already on the address.
This is what fail-open-intercept looks like in C kernel dialect. The pattern is well-established in our exhibits in higher-level runtimes: Tomcat's EncryptInterceptor catches GeneralSecurityException and calls super.messageReceived(msg) outside the try; DataEase's CommunityTokenFilter writes a 401 inside a catch and then calls filterChain.doFilter() after it; Xerte's connector.php issues header('Location: ...') and falls through to the upload handler because PHP's header() does not terminate. The verdict was reached. The listener was wired to a channel the verdict never entered.
ExpGetProcessInformation is the same shape one stack frame lower than the language. The error code goes into a local variable named status. The conditional that gates the writes is infoClass == 253, not status == 0. The error and the writes occupy different state. The function does not consult its own verdict before acting.
Class 253 reuses v95. Classes 5 and 252 do not.
The five info classes that route through ExpGetProcessInformation were not written together. Class 5 (SystemProcessInformation) has been in ntoskrnl.exe since Windows NT 3.1, and reads through a local variable named v81 in the decompile. Class 252 (SystemProcessInformationWithExtension, the first variant) reads through v86. Class 253 (SystemProcessInformationExtension, the version that returns the per-process Pico-process and container extensions) reads through v95. The other two classes that share the function, 0x39 and 0x94, take different code paths and do not touch the user buffer the way classes 5, 252, and 253 do.
Classes 5 and 252 perform an explicit NULL check on v81 and v86 before dereferencing inside the per-process loop. Class 253 does not. The handler for 253 binds v95 = v91 at line 8 of the simplified function, jumps past the NULL-or-zero check that the other classes execute, and proceeds straight into LABEL_11. The check is in the function. It is on the path the other classes take. It is not on the path class 253 takes.
This is the across-info-classes variant of parallel-implementation-gap. The capability ("read per-process accounting into a caller-named buffer") is implemented five times in one function, dispatched by a switch on infoClass. Four of those implementations share a NULL/sentinel check before the dereference. The fifth, written separately to support a newer info class, reuses a different local and inherited none of the older paths' precautions. We have seen this shape across packages (Astro shipped two /_image endpoints, only one read the allowlist), across runtimes (MLflow's basic-auth gated Flask but not three FastAPI routers), across upload-versus-download directions (mcp-atlassian's path patch hardened both downloads and neither upload), and across branches of one function (Axios's maxContentLength lived inside the buffered branch's counter and the streaming branch had no counter to attach it to). CVE-2026-40369 is the same shape compressed into one function's switch arms.
The check the divergent path is missing is not exotic. It is the same NULL test the other arms run, three lines higher in the same body of code. The handler for class 253 has the local variable that holds the user pointer and the variable that stores the length-mismatch error. It does not have the line that would return.
Length zero was the contract. The kernel signed the contract and then broke it.
ProbeForWrite's body, as it ships in ntoskrnl.exe, reads roughly:
void ProbeForWrite(volatile void *Address, SIZE_T Length, ULONG Alignment)
{
if (Length) {
// ... alignment check ...
// ... range check against MmUserProbeAddress ...
// ... touch each page in the range to fault user-mapped memory ...
}
}
The gate at the top is the kernel's way of saying: when Length is zero, there is nothing for me to check and nothing for my caller to write. The contract is reflexive. It binds both ends. The caller is supposed to read it and not write.
NtQuerySystemInformation is a sizing-aware API. The documented usage pattern is two calls. First with SystemInformationLength=0 to retrieve the required size via ReturnLength, then again with an allocated buffer of the named size. The contract that ProbeForWrite encodes is the API contract: Length=0 is the sizing call. No writes happen in a sizing call.
ExpGetProcessInformation for class 253 does not honour the contract. It records STATUS_INFO_LENGTH_MISMATCH because it can see the buffer is too small, and then it writes to the buffer because the writes are not gated on the buffer size. The error code is the caller's signal that no writes happened. The kernel sets it after the writes happen.
Classes 5 and 252 honour the contract because their per-process loop checks v81 != NULL or v86 != NULL before each dereference. Class 253 does not, because the divergent module's author copied the loop body without copying the check.
NtQuerySystemInformation is reachable from the Chrome renderer.
Microsoft Edge, Google Chrome, and every other Chromium browser run their renderer processes inside the Windows sandbox implementation in chromium/sandbox/win/. The renderer's primary token is USER_LOCKDOWN: every group SID is deny-only, the only restricting SID is the NULL SID S-1-0-0, the user's own SID is deny-only, every privilege has been removed, and the integrity level is UNTRUSTED. The process runs inside a job object with JOB_OBJECT_LIMIT_ACTIVE_PROCESS=1 and JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. Win32k system calls are disabled via ProcessSystemCallDisablePolicy. Child-process creation is blocked. Image loads are restricted to Microsoft-signed binaries. By design, the renderer is the most-constrained process Microsoft ships.
NtQuerySystemInformation is not in the blocked-syscall set. The Chromium codebase calls it directly, in base/process/process_metrics_win.cc and several other places, to introspect the renderer itself. Removing it would break the diagnostics the renderer depends on. The syscall is callable from inside the lockdown token.
CVE-2026-40369's primitive is one syscall. NtQuerySystemInformation(SystemProcessInformationExtension, attackerAddr, 0, &needed). The kernel does not inspect the token's privileges, integrity level, or restricting SIDs before executing the loop that writes to v95. It iterates the active-process list, which any unprivileged process can already enumerate, and increments three DWORDs at the address the caller named. The token's integrity could be UNTRUSTED. The token's privileges could be zero. The restricting SID could be S-1-0-0. The writes happen.
The third directory in Ori Nimron's repository, full_poc_with_chrome_sandbox_emulator/, is fourteen hundred lines of C that reverse-engineers chromium/sandbox/win/src/restricted_token.cc, restricted_token_utils.cc, sandbox_policy_base.cc, broker_services.cc, target_services.cc, and sandbox/policy/win/sandbox_win.cc, and constructs a renderer-equivalent sandbox in-process. The broker creates a lockdown primary token with the NULL SID as the only restricting SID, then an USER_RESTRICTED_SAME_ACCESS impersonation token, then a kLockdown job object, sets the impersonation token on the suspended child thread, resumes the child, and the child calls its own LowerToken() that sets UNTRUSTED integrity, RevertToSelfs into the lockdown primary, applies twelve process mitigations including ProcessSystemCallDisablePolicy, and runs eleven verification tests.
The eleven tests:
test_integrity(); // Token integrity = Untrusted
test_deny_only_sids(); // All non-logon SIDs deny-only
test_user_sid_deny_only(); // User SID deny-only
test_restricting_sids(); // Restricting SID = NULL SID (S-1-0-0)
test_privileges(); // All privileges stripped (count=0)
test_file_access(); // File read denied (kernel32.dll)
test_registry_access(); // Registry read denied (HKLM\SOFTWARE)
test_process_creation(); // Process creation blocked
test_job_object(); // Process in job object
test_desktop_isolation();
test_write_access(); // Write access denied
Eleven tests prove the sandbox is real. After the eleventh, the code calls exp(), which is the full kernel exploit chain. The author did not need to claim reachability. He shipped a process that builds the most-constrained Windows token there is and then escapes it.
One arbitrary increment, used three ways.
The basic PoC writes to one address and crashes. The full PoC in full_poc/full_poc.cpp does six things with the same primitive.
The first use is to corrupt CmpLayerVersionCount, a global in the registry component of ntoskrnl.exe, until the count is high enough that index 9 of CmpLayerVersions[] becomes reachable. That moves the increment from a one-time bug into a means of bumping a counter past a bounds check.
The second use is to corrupt CmpLayerVersions[9] itself, one DWORD at a time, until the pointer it holds matches a usermode allocation at 0x10000 that the exploit has filled with a fake _FAKE_VERSION_STRUCT. The fake struct contains a UNICODE_STRING64 whose Buffer field is the kernel address the attacker wants to read.
The third use is no longer the bug itself. With CmpLayerVersions[9] redirected to attacker-controlled memory, NtQuerySystemInformationEx(SystemBuildVersionInformation, &index=9, ...) reads through the fake UNICODE_STRING64, dereferences the kernel address the attacker named, downcasts the wide-string at that address into a UTF-8 narrow-string, and returns the bytes. CVE-2026-40369's increment has been parlayed into a kernel arbitrary read.
The fourth use walks PsInitialSystemProcess, follows ActiveProcessLinks, finds the current process's EPROCESS, and reads the token EX_FAST_REF at offset 0x248. Masking the bottom four bits gives the token pointer.
The fifth use returns to the original increment. The exploit names token + 0x42 (the Privileges.Enabled bitmap) and increments the DWORD until the bit for SeDebugPrivilege is set. Then it names token + 0x42 + 12 (the Privileges.Present bitmap) and does the same. The current process now has SeDebugPrivilege enabled.
The sixth step is what SeDebugPrivilege is for: OpenProcess(PROCESS_ALL_ACCESS, FALSE, 796), where 796 is the PoC's hardcoded winlogon PID, then VirtualAllocEx, WriteProcessMemory with a cmd.exe-spawning Win32 shellcode, and CreateRemoteThread. The renderer process has just executed code as NT AUTHORITY\SYSTEM.
One arbitrary kernel DWORD increment. Three roles in the same chain. One missing return statement in ExpGetProcessInformation.
The CVSS vector measures a different threat model.
NVD scored CVE-2026-40369 as CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. PR:L is "low privileges required," which is the standard rating for an LPE that runs from any logged-in user account.
The PoC ran from a process whose token had been reduced to: every group SID deny-only, every privilege stripped, NULL SID as the only restricting SID, Untrusted integrity. The thirteen lines of test_privileges() verify that the privilege count is zero before exp() is called. There is no privilege below zero. CVSS 3.1 does not have a vector value for "fewer privileges than a logged-in user." It assumes the lowest meaningful privilege level is "low," because every other case is "none required."
NtQuerySystemInformation is callable from a token with zero privileges. The PoC measured the chain inside a Chrome-renderer-equivalent token and ran to completion. The vector did not foresee that operational case, because the vector predates the threat model in which a single Windows process is supposed to be more constrained than a logged-in user.
What is in Ori Nimron's repository.
Three things. A 64-line basic reproducer that does the arbitrary increment. A full chain that turns the increment into SYSTEM by reusing the same primitive in three roles, with the help of a type-confusion in SystemBuildVersionInformation. And a 1400-line replica of Chrome's renderer sandbox whose only job is to demonstrate that none of the sandbox's restrictions affect the syscall the chain depends on.
The bug is one absence of a return statement after a length check fires in ExpGetProcessInformation for info class 253. The handlers for classes 5 and 252 have the equivalent guard. The handler for 253 does not, because it was written separately and reused a different local variable. The mismatch was recorded as the function's return value. The writes happened first.
PoC: orinimron123/CVE-2026-40369-EXPLOIT