KB5040434: Windows Server 2016 Security Update (July 2024)
An attacker can take over any Windows Server running the Remote Desktop Licensing role by sending a single crafted RPC request, with no credentials.
An attacker who can reach TCP 135 plus the dynamic RPC range on a Remote Desktop Licensing server can send a crafted request that triggers the integer underflow and runs code in the licensing-service context, typically SYSTEM. From SYSTEM the attacker has full control of the licensing server — a system that, by design, is reachable from every RDS host in the environment.
The Remote Desktop Licensing Service is the Windows Server role that issues and tracks RDS client access licences (CALs) — required for any production RDS deployment beyond a small admin lab. The service listens on the RPC endpoint mapper (TCP 135) and dynamic high ports. An integer-underflow bug in how it parses incoming requests causes an arithmetic operation to wrap, leading to memory corruption that an attacker can use to execute code.
Probably yes if any of these apply:
Affected OS versions
A penetration tester finds an RDS deployment used for a vendor application. The RD Licensing server sits behind the same firewall as the RD Session Hosts and is reachable from them. The tester sends one crafted RPC request, lands SYSTEM on the licensing server, and from that pivot has direct access to every RDS host and every authenticated session passing through them.
Manual download
For air-gapped servers or out-of-band deployment. Microsoft Update Catalog returns every OS-version variant of this update.
↗ Microsoft Update CatalogKB5040434Manual remediation steps
Prerequisites
Estimated time
20–40 minutes per server (download + install + reboot)
Reboot required
Yes — install the cumulative update and reboot the server before the fix is active.
Steps
1. Confirm the server is missing the patch
Get-HotFix -Id KB5040434 -ErrorAction SilentlyContinue
2. Install the update — pick one channel
Windows Update / WSUS (preferred):
UsoClient ScanInstallWait
# (or use your standard WSUS / SCCM / Intune deployment for KB5040434)
Manual download (offline / air-gapped):
3. Reboot
Restart-Computer -Force
Verification
Get-HotFix -Id KB5040434
[System.Environment]::OSVersion.Version
If Get-HotFix returns nothing for KB5040434, the install did not take — re-run from a different channel.
Rollback
wusa.exe /uninstall /kb:5040434 /quiet /norestart
# Reboot after uninstall
Removing a cumulative update also removes every fix it delivered — prefer rolling forward.
Notes
No tested PowerShell script for this entry yet. We’re prioritising automation based on user demand.