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.
Exploits & PoC
15 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 |
|---|---|---|---|
| qi4L/CVE-2024-38077 | 224 | 2024-08-09 | RDL的堆溢出导致的RCE |
| mrmtwoj/CVE-2024-38077 | 18 | 2024-10-09 | CVE-2024-38077: Remote Code Execution Vulnerability in Windows Remote Desktop Licensing Service |
| murphysecurity/RDL-detect | 13 | 2024-08-09 | 远程探测 remote desktop licensing 服务开放情况,用于 CVE-2024-38077 漏洞快速排查 |
| SecStarBot/CVE-2024-38077-POC | 9 | 2024-08-09 | |
| zhuxi1965/CVE-2024-38077-RDLCheck | 7 | 2024-08-10 | 检测RDL服务是否运行,快速排查受影响资产 |
| BBD-YZZ/fyne-gui | 7 | 2024-08-15 | CVE-2024-38077,仅支持扫描测试~ |
| Wlibang/CVE-2024-38077 | 3 | 2024-08-09 | CVE-2024-38077,本仓库仅用作备份, |
| atlassion/CVE-2024-38077-check | 2 | 2024-08-10 | 基于135端口检测目标是否存在CVE-2024-38077漏洞 |
| Destiny0991/check_38077 | 2 | 2024-08-23 | Windows远程桌面授权服务CVE-2024-38077检测工具 |
| Sec-Link/CVE-2024-38077 | 1 | 2024-08-09 | |
| psl-b/CVE-2024-38077-check | 1 | 2024-08-09 | |
| Ermensonx/CVE-2024-38077-MadLicense-exploit | 1 | 2025-12-14 | |
| lworld0x00/CVE-2024-38077-notes | 0 | 2024-08-10 | |
| Accord96/CVE-2024-38077-POC | 0 | 2025-01-23 | CVE-2024-38077-POC |
| razureink/cve-2024-38077-madlicense_reproduction | 0 | 2026-07-23 | CVE Reproduction: cve-2024-38077-madlicense_reproduction |