Windows Remote Desktop Gateway Service Heap Overflow — Network RCE (CVE-2025-29967)
A heap-based buffer overflow in the Remote Desktop Gateway service (the RD Gateway role exposed at the network edge for tunnelling RDP over HTTPS) allows an unauthorized attacker to execute code over the network. CVSS 8.8. Patched in the May 13 2025 cumulative.
An unauthenticated attacker who can reach the RD Gateway TLS endpoint (typically internet-facing, by design) can execute code on the Gateway server. Because RD Gateway is deliberately placed in front of the internal RDS environment, successful exploitation gives the attacker a foothold inside the Remote Desktop infrastructure — a high-value position for pivoting to user sessions and connected back-end servers.
CVE-2025-29967 is a heap-based buffer overflow in the Remote Desktop Gateway Service — the Windows Server role that proxies RDP sessions over HTTPS so remote users can connect to internal RDS hosts without a VPN. The service parses HTTP/RPC-over-HTTPS framing data from clients, and a crafted request can overflow a heap buffer leading to code execution in the service context.
Probably yes if any of these apply:
Affected OS versions
Microsoft did not flag CVE-2025-29967 as in-the-wild at release, but the prerequisites for mass-exploitation are present: internet-facing service, no authentication required, network attack vector, CVSS 8.8. RD Gateway hosts have been targeted in prior years (BlueGate / CVE-2020-0609 in 2020) — patch this on the same day as any other internet-edge fix.
Manual remediation steps
⏱ 30–60 minutes including rebootIdentify RD Gateway Servers
# On any Windows Server, check whether the RD Gateway role is installed
Get-WindowsFeature -Name RDS-Gateway | Where-Object Installed
# And whether the service is running
Get-Service -Name TSGateway
Apply the Fix
Install the May 2025 Patch Tuesday cumulative for the host's Windows Server OS. The fix ships in the OS rollup, not as a standalone RD Gateway component.
USoClient.exe ScanInstallWait
# Or manual install of KB5058385 / KB5058392 / KB5058411
shutdown.exe /r /t 600 /c "May 2025 security update — reboot in 10 minutes"
Compensating Controls (until patched)
Verify
Get-HotFix | Where-Object { $_.HotFixID -in @("KB5058411","KB5058385","KB5058392") } |
Select-Object HotFixID, InstalledOn
Get-Service -Name TSGateway
# Service should restart cleanly after reboot.
No tested PowerShell script for this entry yet. We’re prioritising automation based on user demand.
References