# CVE-2026-88230 — A 16-bit length truncation in Windows LUAFV path virtualization

*Root-cause analysis from the November 2026 patch diff of `luafv.sys` (10.0.26100.9818 → .9974, KB5132061).*

---

## Summary

`luafv.sys`, the LUA File Virtualization minifilter, reconstructs virtualized file paths by concatenating two
`UNICODE_STRING`s whose `Length` fields are 16-bit byte counts, and it computes the destination allocation size
by **adding those 16-bit lengths in 16-bit arithmetic**. A local, low-privileged attacker who can make the sum
of a device-name prefix plus a caller-supplied path exceed `0xFFFF` wraps the size to a small value,
`LuafvAllocatePool` returns an undersized **paged-pool** buffer, and the subsequent `memmove` +
`RtlAppendUnicodeStringToString` copy the full, un-truncated data past the end — a controlled-length,
controlled-content pool overflow and a clean primitive for elevation to SYSTEM. Microsoft rates it Important,
CVSS 7.8 (`AV:L/AC:L/PR:L/UI:N`), **Exploitation More Likely**. The fix lives in `LuafvSupplyFullPath` and is
gated behind `Feature_605700410`; two sibling name-builders were hardened in the same update.

## The vulnerability

LUAFV sits in the filter stack to give legacy, non-elevated code a private view of protected directories: a
write under `%ProgramFiles%` or `%WinDir%` is transparently redirected into a per-user virtual store. To do
that it must repeatedly rebuild fully-qualified paths, and `LuafvSupplyFullPath(param_1, param_2)` is the helper
that does so. `param_2` is a packed `{ USHORT Length; PWSTR Buffer; }` pair (the decompiler renders the length
as `(ushort)*param_2` and the buffer as `param_2[1]`) carrying the caller's path; `param_1` is the callback
data whose instance object hangs at `+0x10`.

The function builds the result from one of two string sources, and **each is a sink with the same defect**.

The first sink takes the file object's own name. After `LuafvGetNameFileObject` fills a local `UNICODE_STRING`
(`local_28` length, `psStack_20` buffer), the size is formed as:

```c
uVar4 = (ushort)local_28 + 2 + (ushort)*param_2;        // underlying_len + sep + caller_len, all 16-bit
puStack_30 = LuafvAllocatePool(1,(uint)uVar4,'\x02');   // paged pool
memmove(puStack_30,_Src,(ulonglong)uVar9);              // copy underlying name (uVar9 = full length)
RtlAppendUnicodeStringToString(&local_38,param_2);      // then append the caller path
```

The second sink takes the instance-context device-name prefix. `FltGetInstanceContext` yields a context whose
prefix `UNICODE_STRING` lives at offset `+0x18` → `+0x38` (length) and `+0x40` (buffer):

```c
lVar1 = *(longlong *)(local_res10 + 0x18);              // instance context
uVar6 = (ushort)*param_2 + *(short *)(lVar1 + 0x38);    // caller_len + prefix_len, 16-bit
puStack_30 = LuafvAllocatePool(1,(uint)uVar6,'\x02');   // paged pool
memmove(puStack_30,*(void **)(lVar1 + 0x40),*(ushort *)(lVar1 + 0x38));   // copy prefix
RtlAppendUnicodeStringToString(&local_38,param_2);      // then append the caller path
```

The defect is a type error. `UNICODE_STRING.Length` is a `USHORT` — a byte count capped at `0xFFFF`. Summing
two of them (plus a two-byte separator) in 16-bit arithmetic can carry out of the 16-bit range and **wrap**:
`0xFF00 + 0x0200 = 0x10100`, truncated to `0x0100`. The allocation is then sized to the wrapped value while the
`memmove` and the append copy the *real* lengths, writing hundreds of bytes beyond a ~256-byte buffer. Both the
overflow length and its contents derive from attacker-reachable strings (the caller path, and a device/underlying
name that long paths can inflate), so this is a fully controlled out-of-bounds write, not a blind corruption.

A note on confidence: in the diffed **pre** build, `LuafvSupplyFullPath` is a feature-gated stub that simply
`return '\0';`, so the vulnerable body is not present on the old side — it ran on the pre-existing ungated code
path that the diff does not contain. The root cause above is therefore reconstructed from the **checks the patch
adds**: each new bound is, by definition, a bound the vulnerable path lacked. CWE-122 is MSRC's classification and
is consistent with the alloc-sizing guards below. The 16-bit wrap mechanism is proven by the code; the exact
pre-patch call sequence is inferred.

## The patch

The fixed function adds three bounds, all behind `Feature_605700410__private_IsEnabledDeviceUsageNoInline()`:

```c
// (1) clamp the caller length at entry, before any arithmetic
if (((int)uVar5 != 0) && (param_2 != NULL) && (0x200 < (ushort)*param_2))
    *(undefined2 *)param_2 = 0x200;                 // caller path capped at 0x200 bytes

// (2) bound the underlying name in sink 1
if (((1 < uVar9) && (*psStack_20 == 0x5c)) && ((ushort)local_28 < 0x1001)) { ... }   // <= 0x1000

// (3) unsigned-overflow check in sink 2
uVar6 = (ushort)*param_2 + *(short *)(lVar1 + 0x38);
if (uVar6 < (ushort)*param_2) { FltReleaseContext(); return '\0'; }   // sum went down => it wrapped
```

Check (1) caps one operand at `0x200` globally; (2) caps the other at `0x1000` in the first sink; (3) is the
textbook unsigned-wrap test — if adding a non-negative prefix made the total smaller, it overflowed — guarding
the second sink. Together they close both allocation sites. The clamps are also telling: `0x200` and `0x1000`
are the *intended* maxima, which means the pre-patch path accepted lengths an order of magnitude larger. Because
the fix is velocity-gated, a fully-patched build with `Feature_605700410` disabled still executes the unguarded
arithmetic — patch presence is necessary but not sufficient.

## Variant analysis

This is a bug *class* in the LUAFV name-construction family, not a lone function. The same diff modified two
sibling builders with the identical alloc-sizing / bounded-copy signature:

- **`LuafvBuildTableNodeName`** — decompiled size dropped 1035 → 746 bytes, flagged `alloc-sizing, bounded-copy`;
  a substantial rewrite of another name-assembly routine.
- **`LuafvBuildTableNodeName2`** — 732 → 753 bytes, same signals.

And within `LuafvSupplyFullPath` itself there were **two** independent sinks (object-name and instance-prefix),
each needing its own guard — a reviewer who patched only one would have left the other exploitable. The takeaway
for anyone auditing this component: every place LUAFV sums `UNICODE_STRING.Length` values to size an allocation
is a candidate, and the fix should be verified to cover all of them (entry clamp + per-sink guard), not just the
function MSRC happened to name. Worth checking in adjacent minifilters that mirror this pattern (wcifs, bindflt,
cldflt all do similar path reconstruction).

## Exploitation assessment

The primitive is a controlled-length, controlled-content linear overflow in **paged pool** (`LuafvAllocatePool`
with pool-type argument `'\x02'`). The attacker chooses the wrapped allocation's size class by tuning the real
combined length, and controls the overflowing bytes (the appended caller path), which is close to ideal for pool
feng-shui: spray to normalise the paged-pool layout, free holes of the target size, let the undersized LUAFV
buffer land in a hole with a chosen victim object immediately after it, and overflow into that object's header or
an embedded pointer/size field — the standard route to a relative or arbitrary write and ultimately a `_TOKEN`
privilege swap or a `_SEP_TOKEN_PRIVILEGES` edit. No race is required (`AC:L`), and the trigger is a plain file
operation that LUAFV virtualizes, which is why MSRC marks it More Likely.

What the static diff does **not** establish, and an exploit developer would need to confirm dynamically: which
concrete I/O paths let an unprivileged caller drive `param_2->Length` past the wrap threshold (and whether any
earlier layer clamps the path first), how the reachable device/underlying name can be stretched to supply the
second operand, the precise paged-pool size class and a reliable adjacent victim, and whether KASLR/pool-header
cookies demand an info leak first. Treat the SYSTEM EoP as credible and well-supported by the primitive, but not
proven end-to-end from the diff alone.

## Detection & hunting

- **Crash signatures.** Paged-pool corruption bugchecks — `BAD_POOL_HEADER` (0x19), `DRIVER_CORRUPTED_EXPOOL`
  (0xC5), or `PAGE_FAULT_IN_NONPAGED_AREA` (0x50) — with `luafv!LuafvSupplyFullPath`, `luafv!LuafvBuildTableNodeName`,
  or the `LuafvAllocatePool`/append frames on the stack, especially while virtualizing unusually long paths.
- **Deterministic repro aid.** Driver Verifier → Special Pool on `luafv.sys` forces the OOB write to fault at the
  page boundary at the moment of overflow, turning a probabilistic corruption into a clean, attributable crash.
- **Telemetry.** ETW-TI pool-allocation events where a `LuafvAllocatePool` size is immediately followed by a copy
  of a larger length is a high-fidelity (low-volume) signal. For triggering activity, pivot on Sysmon FileCreate
  under the LUAFV virtual store (`…\AppData\Local\VirtualStore\…`) with abnormally long path components from
  medium/low-IL processes.
- **Patch state.** Confirm 24H2 `luafv.sys` 10.0.26100.9974 / KB5132061 (and the equivalent 25H2/26H2 builds) **and**
  that `Feature_605700410` is enabled — a patched-but-flag-off host is still vulnerable.

## References

- MSRC advisory — CVE-2026-88230, Windows LUAFV Elevation of Privilege, 2026-11-10, KB5132061.
- Diffed builds (ghidriff, `--no-bsim`):
  - **Pre** `luafv.sys` 10.0.26100.9818 — SHA-256 `4ba14a254e86fc39e3a26c39246a78c24d31eaea2cd7f6428af293756d697bc1`
    `https://msdl.microsoft.com/download/symbols/luafv.sys/7722129834000/luafv.sys`
  - **Post** `luafv.sys` 10.0.26100.9974 — SHA-256 `c7ae649fce3726920736452ed63d22c891a7caf01e48dc681bbffcd6564a6de9`
    `https://msdl.microsoft.com/download/symbols/luafv.sys/CFC71A3D34000/luafv.sys`
  - Both live at `%SystemRoot%\System32\drivers\luafv.sys` on a 24H2 (26100) host.
- Fix: `LuafvSupplyFullPath` (two sinks), with sibling hardening in `LuafvBuildTableNodeName` /
  `LuafvBuildTableNodeName2`; all gated by `Feature_605700410`. CWE-122. Signals: alloc-sizing, bounded-copy,
  overflow-guard, length-clamp.
