
CVE Reproduction: cve-2024-38077-madlicense_reproduction
RPC over TCP endpoint exposed by mstlsap.dll / tlslicense.dll, triggering a heap buffer overflow that leads to arbitrary code execution in the context of SYSTEM.The Remote Desktop Licensing Service listens on RPC dynamic endpoints (typically ports 49664–49681) reachable via TCP port 135 (RPC Endpoint Mapper). The vulnerability resides in the LicensingSendResponse or related RPC interface handler within the licensing service's heap memory management. By sending a specially crafted licensing protocol request with an oversized or malformed LicensingBinary structure, the service performs an insecure memcpy into a heap buffer of insufficient size, corrupting adjacent heap metadata and enabling code execution.
Key aspects:
Earlier versions (Windows 2000 Server, Server 2003, Server 2008) may also be affected if the RDL service is enabled.
net start "Remote Desktop Licensing"netstat -an | findstr LISTENINGpython exploit.py --target <TARGET_IP>
tlslicense.dll service or a system crash (BSOD depending on heap corruption severity).svchost.exe hosting the RDL service before triggering the exploit and observe the access violation.The accompanying script exploit.py in this directory contains a reproduction of the MadLicense attack. It connects to the target RDL service via RPC over TCP, constructs a malformed licensing request with an oversized binary blob, and triggers the heap buffer overflow.
sc stop "Remote Desktop Licensing"
sc config "Remote Desktop Licensing" start= disabled
| Product | Impact |
|---|
| Windows Server 2008 R2 (all editions) | RCE |
| Windows Server 2012 / 2012 R2 | RCE |
| Windows Server 2016 | RCE |
| Windows Server 2019 | RCE |
| Windows Server 2022 | RCE |
| Windows Server 2025 | RCE |