{"id":4053,"date":"2025-05-19T10:03:27","date_gmt":"2025-05-19T10:03:27","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/05\/19\/windows-remote-desktop-gateway-uaf-vulnerability-allows-remote-code-execution\/"},"modified":"2025-05-19T10:03:27","modified_gmt":"2025-05-19T10:03:27","slug":"windows-remote-desktop-gateway-uaf-vulnerability-allows-remote-code-execution","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/05\/19\/windows-remote-desktop-gateway-uaf-vulnerability-allows-remote-code-execution\/","title":{"rendered":"Windows Remote Desktop Gateway UAF Vulnerability Allows Remote Code Execution"},"content":{"rendered":"<p>    Windows Remote Desktop Gateway UAF Vulnerability Allows Remote Code Execution<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>A critical vulnerability in Microsoft\u2019s Remote Desktop Gateway (RD Gateway) that could allow attackers to execute malicious code on affected systems remotely.<\/p>\n<p>The vulnerability, tracked as <a href=\"https:\/\/cybersecuritynews.com\/microsoft-january-2025-patch-tuesday\/\" target=\"_blank\" rel=\"noreferrer noopener\">CVE-2025-21297<\/a>, was disclosed by Microsoft in their January 2025 security updates and has since been actively exploited in the wild.<\/p>\n<p>The flaw, discovered and reported by VictorV (Tang Tianwen) from Kunlun Lab, stems from a use-after-free (UAF) bug triggered by concurrent socket connections during the initialization of the Remote Desktop Gateway service.<\/p>\n<p>Specifically, the vulnerability exists in the aaedge.dll library, within the CTsgMsgServer::GetCTsgMsgServerInstance function, where a global pointer (m_pMsgSvrInstance) is initialized without proper thread synchronization.<\/p>\n<p>\u201cThe vulnerability occurs when multiple threads can overwrite the same global pointer, corrupting reference counts and ultimately leading to the dereferencing of a dangling pointer \u2013 a classic UAF scenario,\u201d explains the <a href=\"https:\/\/v-v.space\/2025\/05\/15\/CVE-2025-21297\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">security advisory<\/a>.<\/p>\n<p>The race condition allows attackers to exploit a timing issue where memory allocation and pointer assignment occur out of sync, potentially leading to arbitrary code execution. Microsoft has assigned the vulnerability a CVSS score of 8.1, indicating high severity.<\/p>\n<h2 class=\"wp-block-heading\" id=\"attack-methodology\"><strong>Windows Remote Desktop Gateway UAF Vulnerability<\/strong><\/h2>\n<p>According to researchers, successful exploitation requires an attacker to:<\/p>\n<ol class=\"wp-block-list\">\n<li>Connect to a system running the <a href=\"https:\/\/cybersecuritynews.com\/what-is-border-gateway-protocol-bgp\/\" target=\"_blank\" rel=\"noreferrer noopener\">RD Gateway<\/a> role.<\/li>\n<li>Trigger concurrent connections to the RD Gateway (via multiple sockets).<\/li>\n<li>Exploit the timing issue where memory allocation and pointer assignment occur out of sync.<\/li>\n<li>Cause one connection to overwrite the pointer before another finishes referencing it.<\/li>\n<\/ol>\n<p>The exploit involves a nine-step timeline of heap collisions between threads, leading to eventual use of a freed memory block, opening the door for arbitrary code execution.<\/p>\n<p>Multiple versions of Windows Server that utilize RD Gateway for secure remote access are vulnerable, including:<\/p>\n<ul class=\"wp-block-list\">\n<li>Windows Server 2016 (Core and Standard installations).<\/li>\n<li>Windows Server 2019 (Core and Standard installations).<\/li>\n<li>Windows Server 2022 (Core and Standard installations).<\/li>\n<li>Windows Server 2025 (Core and Standard installations).<\/li>\n<\/ul>\n<p>Organizations using RD Gateway as a critical access point for employees, contractors, or partners working remotely are particularly at risk.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEh2aMpY6xWDg531M3aQWOBaj8fByuzm7YBdWzX4kLhe7B_eeSLYx8QG8sNcBKfQtBHWutswBlIBvtMOcOpWS81py0EDhg6nojIoN0Cl4KgdbMEdYjPp2cXVM3pVp7utmtGsBzthPxlCKkSwyjRhhNG5hRXc2_-ujAMuMUcUAOvKVrdK6UJ6JkLGHCldzz-F\/w640-h458\/remote%2520desktop%2520services.webp?ssl=1\" alt=\"\"><\/figure>\n<\/div>\n<p>Microsoft addressed the vulnerability in <a href=\"https:\/\/cybersecuritynews.com\/microsoft-patch-tuesday-may-2025\/\" target=\"_blank\" rel=\"noreferrer noopener\">May 2025 Patch Tuesday<\/a> by introducing mutex-based synchronization, ensuring that only one thread can initialize the global instance at any given time. The following security updates are available:<\/p>\n<ul class=\"wp-block-list\">\n<li>Windows Server 2016: Update KB5050011.<\/li>\n<li>Windows Server 2019: Update KB5050008 (Build 10.0.17763.6775).<\/li>\n<li>Windows Server 2022: Update KB5049983 (Build 10.0.20348.3091).<\/li>\n<li>Windows Server 2025: Update KB5050009 (Build 10.0.26100.2894).<\/li>\n<\/ul>\n<p>Security experts strongly urge organizations to apply these patches immediately. \u201cThis vulnerability represents a critical risk to enterprise environments that rely on Remote Desktop Gateway for secure remote access,\u201d noted a security researcher familiar with the issue.<\/p>\n<p>Until patches can be applied, organizations are advised to monitor RD Gateway logs for unusual activity and consider implementing network-level protections to limit incoming connections to trusted sources.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 87%,rgb(169,184,195) 100%)\"><strong>Vulnerability Attack Simulation on How Hackers Rapidly Probe Websites for Entry Points \u2013 <a href=\"https:\/\/webinars.indusface.com\/15-minute-vulnerability-attack-simulation-insights-to-fortify-edge\/register?utm_source=gbhackers-blog-cta&amp;utm_campaign=2025-may-webinar-vulnerability&amp;utm_medium=referral\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Free Webinar<\/a><\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/windows-remote-desktop-gateway-uaf-vulnerability\/\">Windows Remote Desktop Gateway UAF Vulnerability Allows Remote Code Execution<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Guru Baran<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/windows-remote-desktop-gateway-uaf-vulnerability\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows Remote Desktop Gateway UAF Vulnerability Allows Remote Code Execution A critical vulnerability in Microsoft\u2019s Remote Desktop Gateway (RD Gateway) that could allow attackers to execute malicious code on affected systems remotely. The vulnerability, tracked as CVE-2025-21297, was disclosed by Microsoft in their January 2025 security updates and has since been actively exploited in the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63],"tags":[130],"class_list":["post-4053","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/4053"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=4053"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/4053\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=4053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=4053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=4053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}