CVE-2024-39917
Executive Summary
CVE-2024-39917 is a high-severity vulnerability in the open-source RDP server, xrdp, affecting versions prior to 0.10.0. The flaw lies in the ineffective enforcement of the MaxLoginRetry configuration parameter within /etc/xrdp/sesman.ini. This allows an attacker to perform an unlimited number of login attempts, bypassing the intended brute-force protection mechanism. The vulnerability has a CVSS score of 7.2, indicating a significant risk of unauthorized access through credential brute-forcing. No public exploit code or proof-of-concept is currently available, and the EPSS score is 0.0%, suggesting low exploitation activity at the time of analysis. The primary mitigation is to upgrade to xrdp version 0.10.0 or later.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to a package manager ecosystem (NPM, PyPI, Go, Ruby) but is a system-level service (xrdp) commonly distributed via Linux package managers. Organizations should verify the version of xrdp in their package repositories and ensure it is updated to the patched version.
CVSS Breakdown & Threat Level
- CVSS Score: 7.2 (High)
- Attack Vector (AV): Network (N) – The vulnerability can be exploited remotely over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required for exploitation.
- Privileges Required (PR): None (N) – No authentication is needed to initiate the attack.
- User Interaction (UI): None (N) – The victim does not need to perform any action.
- Scope (S): Unchanged (U) – The impact is confined to the vulnerable component.
- Confidentiality (C): Low (L) – Limited information disclosure possible.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): Low (L) – Limited impact on service availability.
Threat Level: High. The vulnerability allows for unlimited brute-force attacks, significantly increasing the risk of credential compromise. While no active exploitation has been observed, the potential for automated attacks is substantial.
Deep Dive & Mechanics
The xrdp service uses a configuration file /etc/xrdp/sesman.ini to control session management parameters. One such parameter is MaxLoginRetry, which is intended to limit the number of failed login attempts before the session manager blocks further attempts. The vulnerability arises from a logic flaw in the session manager's authentication flow. The counter that tracks login attempts is either not incremented correctly, not checked before allowing a new attempt, or is reset under conditions that should not permit it. This allows an attacker to send an unlimited number of authentication requests without being blocked, enabling brute-force attacks against user credentials.
The root cause is likely in the session manager's code that handles the MaxLoginRetry check. The intended behavior is:
- On each failed login, increment a counter for the source IP or user.
- Before processing a new login attempt, check if the counter exceeds
MaxLoginRetry. - If exceeded, reject the attempt.
The bug means step 2 or 3 is not properly implemented, allowing infinite attempts.
Vulnerable vs. Patched Code
The exact code changes are not publicly available, but the fix likely involves correcting the logic that enforces the MaxLoginRetry limit. A conceptual comparison:
Vulnerable Code (Conceptual):
// In sesman's authentication handler
int login_attempts = 0;
while (1) {
// Receive login attempt
if (authenticate(user, pass)) {
// success
break;
} else {
login_attempts++;
// BUG: The check below is missing or incorrectly placed
// if (login_attempts > MaxLoginRetry) { reject; }
}
}
Patched Code (Conceptual):
int login_attempts = 0;
while (1) {
// Check limit before processing
if (login_attempts >= MaxLoginRetry) {
reject_attempt();
break;
}
// Receive login attempt
if (authenticate(user, pass)) {
// success
break;
} else {
login_attempts++;
}
}
Exploitation & Lab Setup
Red Team (Exploitation)
Since no public exploit code is available, exploitation would involve a custom brute-force script. The attacker would target the xrdp service (typically on port 3389) and send repeated authentication requests.
Example Python Script (Conceptual):
import socket
import struct
def send_rdp_connect(ip, port=3389):
# Simplified RDP connection initiation
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((ip, port))
# Send RDP Connection Request PDU
# ... (omitted for brevity)
return sock
def brute_force(ip, user, password_list):
for password in password_list:
sock = send_rdp_connect(ip)
# Perform authentication
# ... (omitted for brevity)
if "success" in response:
print(f"Found password: {password}")
break
sock.close()
# Usage
brute_force("192.168.1.100", "admin", ["pass1", "pass2", ...])
Lab Setup:
- Install a vulnerable version of xrdp (e.g., 0.9.21) on a Linux VM.
- Configure
MaxLoginRetry=3in/etc/xrdp/sesman.ini. - Restart xrdp service.
- From an attacker VM, run the brute-force script against the target IP.
- Observe that more than 3 attempts are allowed, confirming the vulnerability.
Blue Team (Detection & Defense)
Detection:
- Monitor for excessive failed login attempts from a single source IP to the xrdp service.
- Use the detection rules provided in the Detection Engineering section.
Defense:
- Immediately upgrade to xrdp version 0.10.0 or later.
- Implement network-level rate limiting (e.g., using
fail2banoriptables) to block IPs after a certain number of failed attempts. - Enable logging and alerting for authentication failures.
- Use strong, unique passwords and consider multi-factor authentication (MFA) if possible.
Indicators of Compromise (IOCs)
- Network: High volume of RDP connection attempts (TCP/3389) from a single IP address.
- Logs: Repeated authentication failure entries in
/var/log/xrdp.logor system auth logs. - File: Unusual number of entries in
/var/log/syslogrelated to xrdp authentication. - Process: Elevated CPU usage on the xrdp process due to repeated authentication handling.
Detection Engineering
YARA Rule
rule CVE_2024_39917_xrdp_bruteforce {
meta:
description = "Detects xrdp brute-force attempts exploiting CVE-2024-39917"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-39917"
strings:
$auth_fail = "authentication failed" nocase
$login_attempt = "login attempt" nocase
$xrdp_log = "xrdp" nocase
condition:
# of ($auth_fail) > 10 and # of ($login_attempt) > 10 and $xrdp_log
}
Sigma Rule
title: Excessive xrdp Login Failures
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects multiple failed xrdp login attempts from a single source
author: Valters IT
logsource:
product: linux
service: auth
detection:
selection:
EventID: 1 # Example for syslog
Message: "*xrdp*authentication failed*"
condition: selection | count() by SourceIp > 10
falsepositives:
- Legitimate users forgetting passwords
level: medium
Suricata Rule
alert tcp $EXTERNAL_NET any -> $HOME_NET 3389 (msg:"CVE-2024-39917 xrdp Brute Force Attempt"; flow:to_server; content:"|03 00 00 13 0e|"; depth:5; threshold: type both, track by_src, count 10, seconds 60; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Upgrade xrdp to version 0.10.0 or later. This is the only official patch.
- Workaround: If upgrading is not immediately possible, implement external rate limiting using
fail2banoriptablesto block IPs after a configurable number of failed attempts. - Configuration: Ensure
MaxLoginRetryis set to a reasonable value (e.g., 3-5) in/etc/xrdp/sesman.ini. - Monitoring: Enable detailed logging for xrdp and monitor for brute-force patterns.
- Network Segmentation: Restrict access to the RDP service to trusted IPs only using firewall rules.
Valters IT