CVE-2021-4432
Executive Summary
CVE-2021-4432 is a denial-of-service (DoS) vulnerability in PCMan FTP Server version 2.0.7. The flaw resides in the USER command handler, allowing an unauthenticated remote attacker to crash the server by sending a malformed or specially crafted USER command. With a CVSS score of 5.3 (Medium), the vulnerability is remotely exploitable without authentication, but only impacts availability. No patch has been released by the vendor, and the exploit has been publicly disclosed. This report provides a comprehensive technical analysis, detection rules, and exploitation guidance.
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
CVSS Breakdown & Threat Level
- CVSS Score: 5.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack Vector: Network (AV:N) – remotely exploitable.
- Attack Complexity: Low (AC:L) – no special conditions required.
- Privileges Required: None (PR:N) – unauthenticated.
- User Interaction: None (UI:N) – no user action needed.
- Scope: Unchanged (S:U) – impact confined to the FTP server.
- Confidentiality Impact: None (C:N)
- Integrity Impact: None (I:N)
- Availability Impact: Low (A:L) – server crash or service disruption.
Threat Level: Medium. The vulnerability is easy to exploit but only causes a denial of service, not data compromise.
Deep Dive & Mechanics
The PCMan FTP Server 2.0.7 USER command handler fails to properly validate or sanitize input. When a specially crafted USER command is sent, it triggers a buffer overflow or null pointer dereference, leading to a crash of the FTP service. The exact mechanism involves the server’s handling of the username string; if the string is excessively long or contains specific characters, the server’s internal memory management fails, causing an unhandled exception.
The vulnerability is classified under CWE-400 (Uncontrolled Resource Consumption) because the crash results from resource exhaustion or improper handling of input size. The attack is trivial to execute: an attacker can use a simple script or netcat to send a malformed USER command, causing the server to terminate.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is the USER command handler in PCMan FTP Server 2.0.7. The handler likely uses a fixed-size buffer for the username without bounds checking. A patched version would include input validation, length checks, and proper error handling.
Vulnerable Code (Conceptual):
void handle_user(char *username) {
char buffer[256];
strcpy(buffer, username); // No bounds check
// Process username...
}
Patched Code (Conceptual):
void handle_user(char *username) {
char buffer[256];
if (strlen(username) >= sizeof(buffer)) {
send_response("530 Invalid username length\r\n");
return;
}
strncpy(buffer, username, sizeof(buffer) - 1);
buffer[sizeof(buffer) - 1] = '\0';
// Process username...
}
Exploitation & Lab Setup
Red Team (Exploitation)
Lab Setup:
- Target: Windows machine running PCMan FTP Server 2.0.7 (default port 21).
- Attacker: Kali Linux or any system with netcat.
Exploit Steps:
- Install PCMan FTP Server 2.0.7 on the target.
- Start the FTP service.
- From the attacker machine, connect to the FTP server and send a malformed USER command.
Exploit Command:
echo -e "USER $(python3 -c 'print("A"*1000)')\r\n" | nc -w 2 <target_ip> 21
Expected Result: The FTP server crashes, and the service becomes unavailable.
Note: No public exploit-db code is available, but the above command demonstrates the vulnerability.
Blue Team (Detection & Response)
Detection:
- Monitor FTP logs for excessively long USER commands.
- Use network intrusion detection systems (NIDS) to flag anomalous FTP traffic.
Response:
- Immediately isolate the affected server.
- Restart the FTP service.
- Apply network-level filtering to block malformed FTP commands.
- Consider migrating to a supported FTP server.
Indicators of Compromise (IOCs)
- Network IOCs:
- FTP traffic with USER commands exceeding 256 bytes.
- Repeated connection attempts from the same source IP to port 21.
- Host IOCs:
- FTP server process crash logs (e.g., Event ID 1000 on Windows).
- Memory dump files in the FTP server directory.
- File IOCs:
- None specific, as the exploit is memory-based.
Detection Engineering
YARA Rule
rule CVE_2021_4432_FTP_USER_DoS {
meta:
description = "Detects malformed USER commands targeting PCMan FTP Server 2.0.7"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2021-4432"
strings:
$user_cmd = "USER " ascii wide nocase
$long_string = /USER [A-Za-z0-9]{257,}/ ascii wide
condition:
$user_cmd and $long_string
}
Sigma Rule
title: CVE-2021-4432 PCMan FTP Server USER Command DoS
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects FTP USER commands with excessive length indicating DoS attempt
author: Valters IT
date: 2025-04-10
logsource:
category: network_connection
product: ftp
detection:
selection:
command: "USER"
length: > 256
condition: selection
falsepositives:
- Legitimate long usernames (unlikely)
level: high
Suricata Rule
alert tcp any any -> any 21 (msg:"CVE-2021-4432 PCMan FTP Server USER Command DoS Attempt"; flow:to_server,established; content:"USER "; nocase; pcre:"/USER [A-Za-z0-9]{257,}/"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Mitigation:
- Block FTP traffic from untrusted sources at the network perimeter.
- Use a reverse proxy or FTP firewall to inspect and filter USER commands.
- Restrict access to the FTP server via IP whitelisting.
Long-Term Remediation:
- Since no patch is available, migrate to a supported FTP server (e.g., FileZilla Server, vsftpd).
- Disable the PCMan FTP Server if not critical.
- Monitor for vendor updates or community patches.
Workaround:
- Modify the server configuration to limit username length (if possible).
- Implement an external script to restart the FTP service upon crash.
Valters IT
Securing Digital Frontiers
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.