CVE-2024-30085 — Windows Cloud Files Mini Filter Driver 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:P/RL:O/RC:C
EPSS Score
Affected Products
| Product | KB Article | Severity | Impact | Restart Required |
|---|---|---|---|---|
| Windows 10 Version 1809 for 32-bit Systems | 5039217 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for ARM64-based Systems | 5039217 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for x64-based Systems | 5039217 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for 32-bit Systems | 5039211 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for ARM64-based Systems | 5039211 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for x64-based Systems | 5039211 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for 32-bit Systems | 5039211 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for ARM64-based Systems | 5039211 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for x64-based Systems | 5039211 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 version 21H2 for ARM64-based Systems | 5039213 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 version 21H2 for x64-based Systems | 5039213 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 22H2 for ARM64-based Systems | 5039212 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 22H2 for x64-based Systems | 5039212 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for ARM64-based Systems | 5039212 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for x64-based Systems | 5039212 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2019 | 5039217 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2019 (Server Core installation) | 5039217 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2022 5039227 (Security Update) 5039330 (Security Hotpatch Update) Important Elevation of Privilege 5037782 5037848 Base: 7.8 Temporal: 7.0 Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:P/RL:O/RC:C 10.0.20348.2527 10.0.20348.2522 Yes 5039227 Windows Server 2022 (Server Core installation) 5039227 (Security Update) 5039330 (Security Hotpatch Update) Important Elevation of Privilege 5037782 5037848 Base: 7.8 Temporal: 7.0 Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:P/RL:O/RC:C 10.0.20348.2527 10.0.20348.2522 Yes 5039227 Windows Server 2022, 23H2 Edition (Server Core installation) | 5039236 (Security Update) |
Important | Elevation of Privilege | Yes |
Patches
| Article | Type | Restart |
|---|---|---|
5039217 |
Security Update | Yes |
5039211 |
Security Update | Yes |
5039213 |
Security Update | Yes |
5039212 |
Security Update | Yes |
5039236 |
Security Update | Yes |
Patch Diff
Heap-based buffer overflow in cldflt.sys HsmIBitmapNORMALOpen. Allocates 0x1000-byte HsBm paged pool buffer then copies user-controlled reparse data (HSM_DATA BtRp bitmap element) without bounds check. memcpy_size derives from 16-bit Length field in cloud filter reparse point structure. Trigger: CfRegisterSyncRoot + FSCTL_SET_REPARSE_POINT_EX with IO_REPARSE_TAG_CLOUD_6, then reopen file. Full exploit: two-trigger WNF corruption + ALPC handle table spray + PipeAttribute arbitrary read + token privilege overwrite. CVSS 7.8 local EoP to SYSTEM.
Root Cause Analysis
Root Cause Analysis — CVE-2024-30085
Metadata
| Field | Value |
|---|---|
| CVE | CVE-2024-30085 |
| Binary | cldflt.sys (Windows Cloud Files Mini Filter Driver) |
| Severity | Important (CVSS 7.8) |
| Impact | Elevation of Privilege |
| Bug Class | CWE-122: Heap-based Buffer Overflow |
| Patch | KB5039211 (June 2024) |
| Discoverers | Alex Birnberg (SSD Secure Disclosure), Gwangun Jung & Junoh Lee (Theori) |
1. Executive Summary
CVE-2024-30085 is a heap-based buffer overflow in the Windows Cloud Files Mini Filter Driver (cldflt.sys). The HsmIBitmapNORMALOpen function allocates a fixed 0x1000-byte pool buffer (HsBm tag) but copies user-controlled reparse data without validating that the copy size does not exceed the allocation. An attacker who registers a cloud sync root and crafts a file with malicious reparse data can overflow the paged pool, corrupt adjacent allocations, and escalate to SYSTEM.
2. Vulnerable Function
HsmIBitmapNORMALOpen in cldflt.sys
Pre-patch pseudocode
if (local_70 == 0x0) || (0xffe < memcpy_size - 1) {
Dst = ExAllocatePoolWithTag(PagedPool, 0x1000, 'HsBm');
if (Dst == NULL) { /* error */ }
memcpy(Dst, local_70, memcpy_size); // BUG: no size check
} else {
iVar13 = *(int *)((memcpy_size - 4) + (longlong)local_70);
if (iVar13 == -1 && memcpy_size == 4) {
*(uint *)(Dst + 2) = *(uint *)(Dst + 2) | 0x10;
} else {
Dst = ExAllocatePoolWithTag(PagedPool, 0x1000, 'HsBm');
if (Dst == NULL) { /* error */ }
}
memcpy(Dst, local_70, memcpy_size); // BUG: memcpy_size can exceed 0x1000
}
Post-patch addition
if (((int)uVar7 != 0) && (0x1000 < memcpy_size)) {
HsmDbgBreakOnStatus(STATUS_BUFFER_OVERFLOW);
// error path - reject oversized copies
}
3. Root Cause
The memcpy_size variable derives from the Length field of the _HSM_DATA structure embedded within the cloud filter reparse point. This field is fully user-controlled via FSCTL_SET_REPARSE_POINT_EX. While validation functions (HsmpRpValidateBuffer, HsmpBitmapIsReparseBufferSupported) check element types, counts, and offsets, no function validates that the total data length fits within the 0x1000-byte allocation before calling memcpy.
The allocation is always fixed at 0x1000 bytes (paged pool, tag HsBm), but the copy size can be up to 0xFFFF (16-bit Length field in HSM_DATA). This creates an overflow of up to ~0xEFFF bytes.
4. Reachability / Attack Surface
Call chain
Attacker opens file in sync root directory
-> NTFS post-create callback
-> HsmFltPostCREATE
-> HsmiFltPostECPCREATE
-> HsmpSetupContexts
-> HsmpCtxCreateStreamContext
-> HsmIBitmapNORMALOpen
-> memcpy(HsBm_buffer, reparse_data, user_controlled_size) // OVERFLOW
Prerequisites
- Register a sync root via
CfRegisterSyncRoot()(Cloud Files API, low privilege) - Create a file in the sync root directory
- Set reparse point with
FSCTL_SET_REPARSE_POINT_EXusing tagIO_REPARSE_TAG_CLOUD_6(0x9000601A) - Craft reparse data with nested
FeRpandBtRpstructures passing all element-type validation checks - Reopen the file to trigger the post-create code path
Privilege required
Low (any authenticated user). No special group membership needed.
5. Reparse Data Structure
REPARSE_DATA_BUFFER
├─ ReparseTag: IO_REPARSE_TAG_CLOUD_6 (0x9000601A)
├─ ReparseDataLength
└─ DataBuffer[]
└─ HSM_REPARSE_DATA
├─ Flags: 0x8001 (compressed) or 0x0001 (raw)
├─ Length
└─ HSM_DATA (FeRp)
├─ Magic: "FeRp" (0x70526546)
├─ CRC32 (if Flags & 0x2)
├─ Length (controls memcpy_size)
├─ NumberOfElements (< 0xA)
├─ Elements[0]: Type BYTE (0x07)
├─ Elements[1]: Type UINT32 (0x0A)
├─ Elements[2]: Type UINT64 (0x06)
├─ Elements[4]: Type BITMAP (0x11)
│ └─ HSM_DATA (BtRp)
│ ├─ Magic: "BtRp" (0x70527442)
│ ├─ Elements[0]: Type BYTE
│ ├─ Elements[1]: Type BYTE (value 0x1)
│ ├─ Elements[2]: Type BYTE
│ ├─ Elements[3]: Type UINT64
│ └─ Elements[4]: Type BITMAP (overflow data here)
6. Exploitation (STAR Labs — Cherie-Anne Lee)
Full working exploit published at https://github.com/star-sg/CVE/tree/master/CVE-2024-30085
Strategy (two-trigger approach)
- First trigger: Overflow HsBm into adjacent
_WNF_STATE_DATAobject (paged pool 0x1000 allocation). CorruptDataSizefrom 0xFF0 to 0xFF8, gaining 8-byte OOB read/write. - ALPC handle table spray: Spray
_ALPC_HANDLE_TABLEobjects (0x1000 size) to reclaim freed WNF holes. Read from corrupted WNF leaks_KALPC_RESERVEpointer. - Second trigger: Overflow into another
_WNF_STATE_DATAadjacent to aPipeAttributeobject. Corrupt PipeAttribute’sFlinkto point to fake PipeAttribute in user-mode (SMAP not enabled on Windows). - Arbitrary read: Walk fake PipeAttribute chain to read
EPROCESS→Tokenaddress via ALPC port → OwnerProcess. - Arbitrary write: Overwrite
_KALPC_RESERVEpointer in ALPC handle table (via first WNF) to point to fake_KALPC_RESERVE→ fake_KALPC_MESSAGE. SetExtensionBuffer= token privileges address,ExtensionBufferSize= 0x10, then callNtAlpcSendWaitReceivePortto write 0xFFFFFFFFFFFFFFFF (all privileges enabled). - SYSTEM shell: Open winlogon.exe process handle →
CreateProcesswith that handle → NT AUTHORITY\SYSTEM.
Pool layout
- Paged pool 0x1000-size bucket
- WNF spray: 0x450
_WNF_STATE_DATAobjects (DataSize=0xFF0 → total 0x1000) - Free every alternate WNF to create holes
- Trigger overflow reclaims one hole, corrupts adjacent WNF
7. Detection
Crash signature
BSOD KERNEL_DATA_INPAGE_ERROR or PAGE_FAULT_IN_NONPAGED_AREA when corrupted WNF/ALPC data is accessed. Pool tag HsBm with allocation 0x1000 followed by corruption of adjacent pool chunks.
YARA rule
rule CVE_2024_30085_cldflt_heap_overflow {
meta:
description = "Detects exploit artifacts for CVE-2024-30085 (cldflt.sys heap overflow)"
cve = "CVE-2024-30085"
author = "OnlyFm252"
strings:
$sync_reg = "CfRegisterSyncRoot" ascii
$reparse_ex = "FSCTL_SET_REPARSE_POINT_EX" ascii
$cloud_tag = { 1A 60 00 90 } // IO_REPARSE_TAG_CLOUD_6 little-endian
$btrp_magic = "BtRp" ascii
$ferp_magic = "FeRp" ascii
$wnf_spray = "NtCreateWnfStateName" ascii
$alpc_spray = "NtAlpcCreateResourceReserve" ascii
$pipe_attr = { 3C 00 11 00 } // FSCTL NtFsControlFile pipe attribute
condition:
uint16(0) == 0x5A4D and
4 of ($sync_reg, $reparse_ex, $cloud_tag, $btrp_magic, $ferp_magic) and
2 of ($wnf_spray, $alpc_spray, $pipe_attr)
}
Sigma rule
title: CVE-2024-30085 cldflt.sys Heap Overflow Exploitation Attempt
id: f8a7c3d1-2024-30085-cldflt-heap
status: experimental
description: Detects reparse point manipulation on cloud sync root directories, indicative of CVE-2024-30085 exploitation
references:
- https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-30085
- https://starlabs.sg/blog/2024/12-all-i-want-for-christmas-is-a-cve-2024-30085-exploit/
logsource:
product: windows
category: file_event
detection:
selection_reparse:
TargetFilename|contains: '\Windows\Temp\'
TargetFilename|endswith:
- '.tmp'
- '.dat'
selection_api:
CallTrace|contains:
- 'CfRegisterSyncRoot'
- 'FSCTL_SET_REPARSE_POINT_EX'
condition: selection_reparse and selection_api
falsepositives:
- Legitimate cloud file sync providers (OneDrive, etc.)
level: high
Sysmon config
<!-- CVE-2024-30085: Cloud filter reparse point abuse -->
<RuleGroup groupRelation="or">
<FileCreate onmatch="include">
<Rule groupRelation="and">
<TargetFilename condition="contains">\Windows\Temp\</TargetFilename>
<Image condition="excludes">OneDrive</Image>
<Image condition="excludes">svchost.exe</Image>
</Rule>
</FileCreate>
</RuleGroup>
8. References
- MSRC: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-30085
- STAR Labs writeup: https://starlabs.sg/blog/2024/12-all-i-want-for-christmas-is-a-cve-2024-30085-exploit/
- Exploit source: https://github.com/star-sg/CVE/tree/master/CVE-2024-30085
- KB5039211 patch: https://support.microsoft.com/en-gb/topic/june-11-2024-kb5039211
Attack Path
Local EoP from an unprivileged cloud sync root to SYSTEM via a paged pool overflow in cldflt.sys
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
2 public PoCsUnverified third-party code
Public proof-of-concept repositories aggregated from PoC-in-GitHub. They are not reviewed and may be incomplete, non-functional, or malicious — inspect the code before running anything.
| Repository | Stars | Published | Description |
|---|---|---|---|
| Adamkadaban/CVE-2024-30085 | 7 | 2024-12-25 | CVE-2024-30085 |
| murdok1982/Exploit-PoC-para-CVE-2024-30085 | 0 | 2024-12-28 | Exploit en Python diseñado para aprovechar la vulnerabilidad de elevación de privilegios CVE-2024-30085 |
Detection Rules
Acknowledgments
Gwangun Jung( @pr0ln ) and Junoh Lee( @bbbig12 ) at Theori( @theori_io ) working with Trend Micro Zero Day Initiative
Alex Birnberg