The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-21297

CVE-2025-21297: Windows Server 2008 RCE Vulnerability

CVE-2025-21297 is a remote code execution vulnerability in Microsoft Windows Server 2008 Remote Desktop Services that allows attackers to execute arbitrary code. This article covers technical details, affected versions, and mitigation.

Updated: January 22, 2026

CVE-2025-21297 Overview

CVE-2025-21297 is a critical remote code execution vulnerability affecting Windows Remote Desktop Services (RDS). This Use After Free (CWE-416) vulnerability allows unauthenticated attackers to execute arbitrary code on vulnerable Windows Server systems by sending specially crafted requests to the Remote Desktop Gateway service over the network.

Remote Desktop Services is a core Windows component that enables remote access to desktops and applications, making this vulnerability particularly concerning for enterprise environments that rely heavily on remote access infrastructure.

Critical Impact

Successful exploitation enables unauthenticated remote code execution on Windows Servers running Remote Desktop Gateway, potentially leading to complete system compromise across enterprise remote access infrastructure.

Affected Products

  • Microsoft Windows Server 2008 R2 SP1 (x64)
  • Microsoft Windows Server 2012 and R2
  • Microsoft Windows Server 2016
  • Microsoft Windows Server 2019
  • Microsoft Windows Server 2022
  • Microsoft Windows Server 2022 23H2
  • Microsoft Windows Server 2025 (x64)

Discovery Timeline

  • January 14, 2025 - CVE-2025-21297 published to NVD
  • January 24, 2025 - Last updated in NVD database

Technical Details for CVE-2025-21297

Vulnerability Analysis

This vulnerability is classified as a Use After Free (UAF) memory corruption issue within the Windows Remote Desktop Gateway service. Use After Free vulnerabilities occur when a program continues to reference memory after it has been freed, leading to undefined behavior that attackers can exploit.

In the context of Remote Desktop Services, the vulnerability exists in how the RD Gateway processes certain network requests. When specific conditions are met during request handling, the service may attempt to access a memory region that has already been deallocated. An attacker who can precisely control the timing and content of network requests can potentially manipulate what data occupies the freed memory region, redirecting program execution flow to attacker-controlled code.

The network-based attack vector makes this vulnerability particularly dangerous as it can be exploited remotely without requiring user interaction or prior authentication. The high complexity rating indicates that successful exploitation requires winning a race condition or meeting other specific conditions during the attack.

Root Cause

The root cause of CVE-2025-21297 is a Use After Free (CWE-416) condition in the Remote Desktop Gateway component. This occurs when the RD Gateway service improperly manages memory during the processing of remote desktop connections. The freed memory pointer is not properly nullified or protected, allowing subsequent operations to access and potentially execute code from the dangling reference.

Attack Vector

The attack is conducted over the network against systems running the Remote Desktop Gateway role. An unauthenticated attacker can target the RD Gateway service (typically listening on TCP port 443) by sending specially crafted HTTPS requests designed to trigger the use-after-free condition.

The exploitation requires high attack complexity, suggesting that successful exploitation depends on factors such as timing, memory layout, or specific system states. However, no user interaction is required, and the attacker does not need any privileges on the target system to initiate the attack.

Successful exploitation could result in complete compromise of the target server, including the ability to install malware, access sensitive data, create privileged accounts, and pivot to other systems on the internal network.

Detection Methods for CVE-2025-21297

Indicators of Compromise

  • Unexpected crashes or restarts of the Remote Desktop Gateway service (TSGateway)
  • Unusual memory consumption patterns in the svchost.exe process hosting RD Gateway
  • Suspicious network connections originating from RD Gateway servers to unexpected destinations
  • Anomalous process creation events on RD Gateway servers, particularly child processes spawned by the gateway service

Detection Strategies

  • Monitor Windows Event Logs for Remote Desktop Gateway service crashes (Event ID 1000, 1001 in Application log)
  • Deploy network intrusion detection signatures to identify malformed RD Gateway protocol traffic
  • Implement endpoint detection rules to identify memory corruption exploitation attempts targeting tsgateway.dll
  • Enable Process Creation auditing (Event ID 4688) on RD Gateway servers to detect suspicious child processes

Monitoring Recommendations

  • Configure real-time alerting for RD Gateway service availability and stability metrics
  • Implement network traffic analysis for HTTPS connections to RD Gateway endpoints with anomalous payload characteristics
  • Enable Windows Defender Exploit Guard with Attack Surface Reduction rules on RD Gateway servers
  • Review and baseline normal RD Gateway behavior to identify deviations that may indicate exploitation attempts

How to Mitigate CVE-2025-21297

Immediate Actions Required

  • Apply the Microsoft security update for CVE-2025-21297 immediately on all affected Windows Server systems
  • Restrict network access to Remote Desktop Gateway services using firewall rules to limit exposure to trusted IP ranges
  • Enable Network Level Authentication (NLA) if not already configured to add an authentication layer before full RD Gateway processing
  • Review RD Gateway servers for signs of compromise if they were internet-exposed prior to patching

Patch Information

Microsoft has released a security update addressing this vulnerability as part of their January 2025 security updates. Administrators should refer to the Microsoft Security Update Guide for CVE-2025-21297 for detailed patch information and download links for each affected Windows Server version.

The update addresses the memory management issue in the Remote Desktop Gateway service to prevent the use-after-free condition from being exploitable.

Workarounds

  • Disable the Remote Desktop Gateway role on servers where it is not actively required
  • Place RD Gateway servers behind a VPN to require authentication before network-level access is possible
  • Implement network segmentation to isolate RD Gateway servers and limit lateral movement potential if compromise occurs
  • Consider deploying Azure Application Gateway or other reverse proxy solutions with Web Application Firewall capabilities in front of RD Gateway
bash
# Disable Remote Desktop Gateway service if not required
Stop-Service -Name TSGateway
Set-Service -Name TSGateway -StartupType Disabled

# Verify service status
Get-Service -Name TSGateway | Select-Object Name, Status, StartType

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechWindows

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability2.55%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-416

  • NVD-CWE-noinfo
  • Vendor Resources
  • Microsoft Security Update CVE-2025-21297
  • Related CVEs
  • CVE-2026-31995: Openclaw Command Injection Vulnerability

  • CVE-2026-25190: Windows GDI RCE Vulnerability

  • CVE-2026-25166: Windows System Image Manager RCE Flaw

  • CVE-2026-25173: Windows RRAS RCE Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English