Windows Remote Desktop Services Remote Code Execution Vulnerability (CVE-2025-27480)
A use-after-free flaw exists in the Remote Desktop Gateway Service. An unauthenticated attacker could exploit it by connecting to a system with that role and winning a race condition to execute arbitrary code.
Description
Use after free in Remote Desktop Gateway Service allows an unauthorized attacker to execute code over a network.
FAQ
How could an attacker exploit this vulnerability? An attacker could successfully exploit this vulnerability by attempting to connect to a system with the Remote Desktop Gateway role, triggering the race condition to create a use-after-free scenario, and then leveraging this to execute arbitrary code.
FAQ
According to the CVSS metric, the attack complexity is high (AC:H). What does that mean for this vulnerability? Successful exploitation of this vulnerability requires an attacker to win a race condition.
Remote Desktop Gateway Service
Remote Desktop Gateway Service
Microsoft
Microsoft
Customer Action Required
Yes
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a race condition in the Remote Desktop Gateway Service leads to a use-after-free of memory.
Impact
An unauthenticated attacker could execute arbitrary code on the gateway, but exploitation requires winning a race condition, which makes it complex.
What the attacker needed
Network access to a Remote Desktop Gateway; win a race condition
How it was found
- Connect to a system that has the Remote Desktop Gateway role.
- Trigger the race condition to create a use-after-free.
- Leverage the use-after-free to execute arbitrary code.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A use-after-free is a memory bug where a program keeps using a piece of memory after it has been freed, which can let an attacker control what happens next. Here, an attacker who can reach a Remote Desktop Gateway could try to trigger this bug and run their own code on the server. The catch is that they must win a race condition, meaning they have to get the timing just right.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.