IRONSMITHINTEL
CRITICALCVSS9.8
|CVE-2024-38074|Auth: none|Reboot: required|Manual only

KB5040437: Windows Server 2022 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.

Published Jul 9, 2024 · Updated May 21, 2026
Why patchRisk explained in plain English
Worst-case scenarioIf unpatched

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.

How the attack works

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.

Am I affected?Quick check

Probably yes if any of these apply:

Windows Servers running the Remote Desktop Licensing role
Any RDS deployment with a dedicated licensing server

Affected OS versions

Windows Server 2022
Real-world incidentsWhat we've seen

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.

How to patch

Manual download

For air-gapped servers or out-of-band deployment. Microsoft Update Catalog returns every OS-version variant of this update.

↗ Microsoft Update CatalogKB5040437

Manual remediation steps

Prerequisites

    1
    Local administrator on the target server
    1
    Maintenance window with reboot capacity
    1
    Current backup or snapshot you can roll back to
    1
    Network path to Windows Update / WSUS / Microsoft Update Catalog

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 KB5040437 -ErrorAction SilentlyContinue

2. Install the update — pick one channel

Windows Update / WSUS (preferred):

UsoClient ScanInstallWait
# (or use your standard WSUS / SCCM / Intune deployment for KB5040437)

Manual download (offline / air-gapped):

1
Open Microsoft Update Catalog: https://catalog.update.microsoft.com/Search.aspx?q=KB5040437
2
Download the MSU for Windows Server 2022 that matches your architecture (x64).
3
Copy the .msu file to the server and run as Administrator.

3. Reboot

Restart-Computer -Force

Verification

Get-HotFix -Id KB5040437
[System.Environment]::OSVersion.Version

If Get-HotFix returns nothing for KB5040437, the install did not take — re-run from a different channel.

Rollback

wusa.exe /uninstall /kb:5040437 /quiet /norestart
# Reboot after uninstall

Removing a cumulative update also removes every fix it delivered — prefer rolling forward.

Notes

    1
    This entry covers Windows Server 2022 specifically (KB5040437). Other Windows Server versions have their own KB for CVE-2024-38074.
    1
    Reference advisories: MSRC https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-38074 and NVD https://nvd.nist.gov/vuln/detail/CVE-2024-38074.
PowerShell automationComing soon

No tested PowerShell script for this entry yet. We’re prioritising automation based on user demand.