CVE-2026-40404 — Windows Universal Disk Format File System Driver (UDFS) Elevation of Privilege Vulnerability
Executive Summary
None
Overview
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C
EPSS Score
Affected Products
| Product | KB Article | Severity | Impact | Restart Required |
|---|---|---|---|---|
| Windows 10 Version 1607 for 32-bit Systems | 5094122 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1607 for x64-based Systems | 5094122 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for 32-bit Systems | 5094123 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for x64-based Systems | 5094123 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for 32-bit Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for ARM64-based Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for x64-based Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for 32-bit Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for ARM64-based Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for x64-based Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for ARM64-based Systems | 5093998 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for x64-based Systems | 5093998 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 24H2 for ARM64-based Systems | 5094126 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 24H2 for x64-based Systems | 5094126 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 25H2 for ARM64-based Systems | 5094126 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 25H2 for x64-based Systems | 5094126 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 26H1 for ARM64-based Systems | 5095051 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 version 26H1 for x64-based Systems | 5095051 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2012 | 5094042 (Monthly Rollup) |
Important | Elevation of Privilege | Yes |
| Windows Server 2012 (Server Core installation) | 5094042 (Monthly Rollup) |
Important | Elevation of Privilege | Yes |
| Windows Server 2012 R2 | 5094041 (Monthly Rollup) |
Important | Elevation of Privilege | Yes |
| Windows Server 2012 R2 (Server Core installation) | 5094041 (Monthly Rollup) |
Important | Elevation of Privilege | Yes |
| Windows Server 2016 | 5094122 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2016 (Server Core installation) | 5094122 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2019 | 5094123 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2019 (Server Core installation) | 5094123 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2022 | 5094128 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2022 (Server Core installation) | 5094128 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2025 | 5094125 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2025 (Server Core installation) | 5094125 (Security Update) |
Important | Elevation of Privilege | Yes |
Patches
| Article | Type | Restart |
|---|---|---|
5094122 |
Security Update | Yes |
5094123 |
Security Update | Yes |
5094127 |
Security Update | Yes |
5093998 |
Security Update | Yes |
5094126 |
Security Update | Yes |
5095051 |
Security Update | Yes |
5094042 |
Monthly Rollup | Yes |
5094041 |
Monthly Rollup | Yes |
5094128 |
Security Update | Yes |
5094125 |
Security Update | Yes |
Patch Diff
Numeric-truncation heap overflow (CWE-197 -> CWE-122) in udfs.sys UdfInitializeAllocations, local EoP via a crafted UDF image (.iso/.img/UDF VHD). The function parses Allocation Descriptors and file-size info while mounting, summing AD lengths and converting to block/sector units by right-shifting Vcb->LBSizeShift (Vcb+0x48) and using the result as a 32-bit VBN/sector count. PRE: the AD-length sum and file size can exceed 32 bits but were used as 32-bit without an upper-bound check, so the high bits truncate (mov edx,edx) and a too-small VBN/sector count is produced; it flows into FsRtlAddLargeMcbEntry / disk-I/O sector counts, so the extent/pool buffer/bitmap is under-mapped while real-size I/O writes past the end -> heap/pool overflow. Diff of udfs.sys 10.0.26100.8521 -> .8655 (Jun 9 2026, KB5094126) confirms the fix: gated behind CFR flag Feature_2146947386, before ScbMcb init if file size (Scb+0x20) > 0xFFFFFFFF<<LBSizeShift -> UdfRaiseStatusEx(0xC0000102 STATUS_DISK_CORRUPT_ERROR); and after accumulating v5 += ad_len & 0x3FFFFFFF, if v5 > 0xFFFFFFFF<<LBSizeShift abort likewise. The same gate was applied across 6 functions on the mount/write/SetEOF paths. Note: our diff shows Feature_2146947386 (build/arch); the 0xFFFFFFFF<<LBSizeShift bound is as described.
Root Cause Analysis
CVE-2026-40404 — Windows UDFS udfs.sys Allocation-Descriptor Length Truncation in UdfInitializeAllocations → Heap Overflow
Summary
| Product | Windows — udfs.sys (Universal Disk Format File System driver) |
| CVE ID | CVE-2026-40404 |
| Impact | Elevation of Privilege |
| MSRC severity | Important |
| CVSS | 7.8 / 6.8 — CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C |
| CWE | CWE-197 Numeric Truncation Error → CWE-122 Heap-based Buffer Overflow |
| Delivery | Local — a crafted UDF image (.iso / .img / UDF VHD) mounted or opened |
| KB / Fixed build | KB5094126 — udfs.sys 10.0.26100.8655 (Win11 24H2 x64) |
| Patch Date | June 9, 2026 (2026-Jun) |
| Pre-patch binary | udfs.sys 10.0.26100.8521 — SHA256 b177af321fdb4ff6907f05b028e7ac33486c2000dbc1e75c4bed848f84e164c6 |
| Post-patch binary | udfs.sys 10.0.26100.8655 — SHA256 2a9b930ad0ccb43fc6b31cb8a600cb026bb5dea9ccf79c28c7d311d65e62be99 |
| Feature flag | Feature_2146947386 — the fix is CFR-gated |
| Exploitability | Exploitation Less Likely; not publicly disclosed; not exploited (per MSRC) |
Product Description
UdfInitializeAllocations parses Allocation Descriptors and initializes a
file’s allocation (extent/run) information while mounting a UDF volume. It sums
the Allocation-Descriptor lengths and file-size information and converts them into
block/sector units by right-shifting by Vcb->LBSizeShift (Vcb + 0x48), using
the result as a 32-bit VBN (Virtual Block Number) / sector count.
Vulnerability Summary
The accumulated Allocation-Descriptor length sum, and the file-size value, can
exceed the 32-bit range, but pre-patch the code did not upper-bound them before
consuming the shifted result as a 32-bit value. When the value exceeds 32 bits
(even after shifting by LBSizeShift), the upper bits are silently truncated
(e.g. mov edx, edx), producing a VBN / sector count smaller than the real
value.
That truncated VBN flows into FsRtlAddLargeMcbEntry (the MCB run-list mapping) or
into a disk-I/O sector count, so the on-disk extent is mapped smaller than it
actually is and the backing pool buffer / bitmap is under-allocated. Later I/O
proceeds on the original (untruncated) size and writes past the end of the
under-sized kernel heap/pool buffer or bitmap — a heap-based buffer overflow
(CWE-197 → CWE-122).
Prerequisites and Constraints
- Local, low-privileged (
PR:L,AV:L,AC:L): auto-mount or open a crafted UDF image (.iso/.img/UDF VHD), or reach the write path. - The image sets an Allocation-Descriptor length sum or file size whose block-converted value overflows 32 bits.
- Result: truncated VBN/sector count → under-allocated pool/bitmap → OOB write.
Vulnerability Details
Root Cause
A 64-bit byte length/size was converted to a block unit and stored/used as 32 bits without first checking that the value fits, so the high bits were dropped and the allocation was sized from the truncated (too-small) value while I/O used the real size.
The patch (confirmed — diff, .8521 → .8655)
Gated behind Feature_2146947386, upper-bound checks are added before the
truncation:
- Before
ScbMcbinitialization: if the file-size value (Scb + 0x20) exceeds0xFFFFFFFF << LBSizeShift, abort withUdfRaiseStatusEx(0xC0000102 = STATUS_DISK_CORRUPT_ERROR). - Immediately after accumulating the AD-length sum (
v5 += ad_len & 0x3FFFFFFF): if the running total exceeds the same0xFFFFFFFF << LBSizeShiftbound, abort likewise.
// UdfInitializeAllocations (10.0.26100.8655) — PATCHED, feature-enabled branch (from our diff)
if ( (0xffffffffL << (Vcb->LBSizeShift & 0x3f)) < *(u64*)(Scb + 0x20) )
UdfRaiseStatusEx(param_1, 0xC0000102, 0); // STATUS_DISK_CORRUPT_ERROR
...
v5 += ad_len & 0x3fffffff;
if ( (0xffffffffL << (Vcb->LBSizeShift & 0x3f)) < v5 )
UdfRaiseStatusEx(param_1, 0xC0000102, 0);
0xFFFFFFFF << LBSizeShift is the largest byte value that still yields a valid
32-bit VBN/sector count after the shift. The same guard was applied across six
functions on the mount, write and SetEOF paths.
Patch Completeness Assessment
CFR-gated behind Feature_2146947386. The bound runs only when the flag is
enabled; the original truncating path still ships when disabled. Verify the flag is
enabled to confirm the fix is live. (Related same-KB UDFS fix: CVE-2026-40409 in
UdfGetBlocksNeeded, gated by Feature_3105867064.)
Detection Guidance
Behavioural. Mounting/opening UDF images with Allocation-Descriptor length sums
or file sizes near/over the 32-bit block boundary; UDFS returning
STATUS_DISK_CORRUPT_ERROR for such images once the fix is active; kernel-pool
overflow crashes in udfs!UdfInitializeAllocations / MCB handling on
unpatched/flag-disabled builds.
Config. The fix is CFR-gated — confirm Feature_2146947386 is enabled.
References
- MSRC advisory — CVE-2026-40404 (Windows UDFS Elevation of Privilege), released 2026-06-09, KB5094126.
- Full binary diff:
/data/patch_diffs/udfs_sys-cve-2026-40404-40409-ghidriff.md
Attack Path
A crafted UDF image's oversized allocation-descriptor sum truncates to a small 32-bit VBN, under-mapping the extent so real-size I/O overflows the pool
Derived from the patch delta: the checks added by the vendor identify which fields crossed a trust boundary unvalidated. Reachability and privilege are taken from the call chain in the RCA report.
Exploits & PoC
Detection Rules
Acknowledgments
R4nger with Kunlun Lab & Zhiniang Peng with HUST