CVE-2021-40524

7.5 HIGH

📋 TL;DR

This vulnerability in Pure-FTPd allows attackers to bypass file size quotas and upload files of unlimited size, potentially causing denial of service or server crashes. The bug occurs due to incorrect handling of -1 values in quota checking logic. All Pure-FTPd servers running versions 1.0.23 through 1.0.49 are affected.

💻 Affected Systems

Products:
  • Pure-FTPd
Versions: 1.0.23 through 1.0.49
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: All configurations using max_filesize quotas are vulnerable. The vulnerability exists in the core quota mechanism.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server resource exhaustion leading to prolonged downtime, data corruption, or system instability requiring manual intervention to restore service.

🟠

Likely Case

Server performance degradation, temporary unavailability, or crashes requiring service restart, potentially disrupting legitimate FTP operations.

🟢

If Mitigated

Minimal impact with proper monitoring and resource limits, though some performance degradation may still occur during attack attempts.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires FTP upload access. The vulnerability is simple to trigger once authenticated.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.0.50

Vendor Advisory: https://github.com/jedisct1/pure-ftpd/commit/37ad222868e52271905b94afea4fc780d83294b4

Restart Required: Yes

Instructions:

1. Download Pure-FTPd 1.0.50 or later from official sources. 2. Stop the Pure-FTPd service. 3. Install the new version following your distribution's package management or compile from source. 4. Restart the Pure-FTPd service.

🔧 Temporary Workarounds

Disable file uploads

linux

Temporarily disable FTP upload functionality to prevent exploitation

# Edit pure-ftpd.conf and set: NoAnonymous no
# Or use: pure-ftpd -A to disable anonymous uploads

Implement external quota enforcement

linux

Use operating system or filesystem quotas instead of Pure-FTPd's internal mechanism

# Set filesystem quotas: setquota -u ftpuser 100M 200M 0 0 /home
# Or use disk limits in pure-ftpd.conf

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate FTP servers from critical systems
  • Deploy rate limiting and file size monitoring at the network perimeter

🔍 How to Verify

Check if Vulnerable:

Check Pure-FTPd version: pure-ftpd --version or rpm -q pure-ftpd or dpkg -l pure-ftpd

Check Version:

pure-ftpd --version 2>&1 | head -1

Verify Fix Applied:

Verify version is 1.0.50 or higher and test file uploads with size limits

📡 Detection & Monitoring

Log Indicators:

  • Unusually large file uploads in FTP logs
  • Multiple failed quota enforcement messages
  • Server restart events following large uploads

Network Indicators:

  • Sustained large FTP data transfers exceeding configured limits
  • Multiple FTP STOR commands for large files

SIEM Query:

source="ftp.log" (STOR OR APPE) AND bytes_transferred > [configured_limit]

🔗 References

📤 Share & Export