CVE-2024-38077 — Windows Remote Desktop Licensing Service Remote Code Execution Vulnerability
Executive Summary
None
Overview
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/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 Server 2008 for 32-bit Systems Service Pack 2 5040499 (Monthly Rollup) 5040490 (Security Only) Critical Remote Code Execution 5039245 Base: 9.8 Temporal: 8.5 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 6.0.6003.22769 Yes 5040499 5040490 Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation) 5040499 (Monthly Rollup) 5040490 (Security Only) Critical Remote Code Execution 5039245 Base: 9.8 Temporal: 8.5 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 6.0.6003.22769 Yes 5040499 5040490 Windows Server 2008 for x64-based Systems Service Pack 2 5040499 (Monthly Rollup) 5040490 (Security Only) Critical Remote Code Execution 5039245 Base: 9.8 Temporal: 8.5 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 6.0.6003.22769 Yes 5040499 5040490 Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation) 5040499 (Monthly Rollup) 5040490 (Security Only) Critical Remote Code Execution 5039245 Base: 9.8 Temporal: 8.5 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 6.0.6003.22769 Yes 5040499 5040490 Windows Server 2008 R2 for x64-based Systems Service Pack 1 5040497 (Monthly Rollup) 5040498 (Security Only) Critical Remote Code Execution 5039289 Base: 9.8 Temporal: 8.5 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 6.1.7601.27219 Yes 5040497 5040498 Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation) 5040497 (Monthly Rollup) 5040498 (Security Only) Critical Remote Code Execution 5039289 Base: 9.8 Temporal: 8.5 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C 6.1.7601.27219 Yes 5040497 5040498 Windows Server 2012 | 5040485 (Monthly Rollup) |
Critical | Remote Code Execution | Yes |
| Windows Server 2012 (Server Core installation) | 5040485 (Monthly Rollup) |
Critical | Remote Code Execution | Yes |
| Windows Server 2012 R2 | 5040456 (Monthly Rollup) |
Critical | Remote Code Execution | Yes |
| Windows Server 2012 R2 (Server Core installation) | 5040456 (Monthly Rollup) |
Critical | Remote Code Execution | Yes |
| Windows Server 2016 | 5040434 (Security Update) |
Critical | Remote Code Execution | Yes |
| Windows Server 2016 (Server Core installation) | 5040434 (Security Update) |
Critical | Remote Code Execution | Yes |
| Windows Server 2019 | 5040430 (Security Update) |
Critical | Remote Code Execution | Yes |
| Windows Server 2019 (Server Core installation) | 5040430 (Security Update) |
Critical | Remote Code Execution | Yes |
| Windows Server 2022 | 5040437 (Security Update) |
Critical | Remote Code Execution | Yes |
| Windows Server 2022 (Server Core installation) | 5040437 (Security Update) |
Critical | Remote Code Execution | Yes |
| Windows Server 2022, 23H2 Edition (Server Core installation) | 5040438 (Security Update) |
Critical | Remote Code Execution | Yes |
Patches
| Article | Type | Restart |
|---|---|---|
5040485 |
Monthly Rollup | Yes |
5040456 |
Monthly Rollup | Yes |
5040434 |
Security Update | Yes |
5040430 |
Security Update | Yes |
5040437 |
Security Update | Yes |
5040438 |
Security Update | Yes |
Patch Diff
MadLicense: pre-auth, 0-click heap overflow in the Windows Server Remote Desktop Licensing service (lserver.dll). CDataCoding::DecodeData allocates a fixed-size heap buffer (HeapAlloc(hHeap, 8, DAT_0); 21 bytes per the MadLicense research) and decodes a caller-supplied Base24 string into it in a loop bounded only by the string's NUL terminator - the encoded length is never checked against the allocation. Each carry-producing base-24 digit advances the write index and writes _Dst[idx] with no bound, overflowing the buffer with attacker-influenced bytes. Reachable pre-auth via RPC TLSRpcTelephoneRegisterLKP (opnum 49, DCERPC/TCP 135) in the NT AUTHORITY\NETWORK SERVICE process; CVSS 9.8. IN-HOUSE ghidriff diff of Server 2019 10.0.17763.5830 -> .6054 shows the July 2024 fix is TWO layers: (1) a bounds check (DAT_0 <= idx) added at both write sites in DecodeData, GATED behind CFR flag Feature_1932091707_50631810 - with the flag off the patched binary still overflows; (2) a new RPC security callback TLSRpcSecurityCallback, registered via RpcServerRegisterIf2, that rejects callers below RPC_C_AUTHN_LEVEL_PKT_PRIVACY (6) with a registry opt-out DisableWorkgroupAuthEnforcement - this is the layer that removes the pre-auth reachability.
| Function | Address | Change | Note |
|---|---|---|---|
CDataCoding::DecodeData |
180057db0 -> 1800584d8 |
code (bounds check added, CFR-gated) | Pre-patch: fixed-size HeapAlloc(_,8,DAT_0) buffer, decode loop `for (; *param_1 != 0; ...)`, trailing `_Dst[uVar1] = (byte)(uVar4 >> 8)` with no bound. Post-patch adds `EvaluateCurrentState(&g_Feature_1932091707_50631810...)` and `if (iVar2 != 0 && DAT_0 <= idx) goto error` at BOTH write sites (inner loop and carry write). Length 284 -> 361; match ratio 0.4/b_ratio 0.85. The guard fires only when the feature flag is enabled. |
TLSRpcSecurityCallback |
1800062a0 (new) |
added (RPC auth enforcement) | New function, not present pre-patch. Registered on the RDL interface via RpcServerRegisterIf2 (newly imported). Uses RpcServerInqCallAttributesW to require auth level 6 (RPC_C_AUTHN_LEVEL_PKT_PRIVACY) over ncalrpc/ncacn_np/ncacn_ip_tcp; honours registry opt-out DisableWorkgroupAuthEnforcement under System\CurrentControlSet\Policies. Removes the pre-auth reachability that made the bug 9.8. |
TLSRpcTelephoneRegisterLKP |
|
entry (RPC opnum 49) | Unauthenticated DCERPC method that passes the attacker-controlled Base24 string to DecodeData. After the patch it sits behind TLSRpcSecurityCallback. |
Attack Path
A fixed-size heap buffer is decoded into with no length check, overflowing from an unauthenticated RPC call
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.