CVE-2009-5010: Race Condition in pyftpdlib

pyftpdlib Updated 14 Dec 2025

Summary

02/05/2022
Yes i
Moderate
6.3

CVE-2009-5010: Race condition in the FTPHandler class in ftpserver.py in pyftpdlib before 0.5.1 allows remote attackers to cause a denial of service (daemon outage) by establishing and then immediately closing a TCP connection, leading... Affects pyftpdlib versions < 0.5.1. Fixed in 0.5.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

pyftpdlib is a Python FTP server library that provides a high-level interface for implementing FTP servers. It allows developers to create custom FTP servers with ease. The library is widely used in various Python applications that require FTP server functionality. However, versions prior to 0.5.1 are vulnerable to a race condition that can lead to a denial of service (daemon outage) when a remote attacker establishes and immediately closes a TCP connection.

Vulnerability Detail

The vulnerability, identified as CVE-2009-5010, arises from a race condition in the FTPHandler class of pyftpdlib's ftpserver.py file. When a TCP connection is established and closed rapidly, the accept function may return an unexpected value of None. This unexpected behavior can cause a denial of service, resulting in a daemon outage. It is important to note that this vulnerability is distinct from CVE-2010-3494.

How To Fix

Minimum fixed version

0.5.1

This is the first release that contains the fix.

pip install --upgrade "pyftpdlib==0.5.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating pyftpdlib is not immediately feasible, a possible workaround is to implement proper synchronization mechanisms in the affected code. By ensuring that concurrent access to shared resources is properly synchronized, the race condition can be mitigated. Here is an example of how to use a lock to synchronize access to a shared resource:

import threading

lock = threading.Lock()

# Inside the critical section
lock.acquire()
try:
    # Access the shared resource
finally:
    lock.release()

Conclusion

In conclusion, pyftpdlib versions prior to 0.5.1 are vulnerable to a race condition that can result in a denial of service. It is crucial to update to the latest version of pyftpdlib (0.5.1 or later) to mitigate this vulnerability. If immediate updating is not possible, implementing proper synchronization mechanisms can serve as a temporary workaround. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for pyftpdlib →

Share this vulnerability

FAQ

pyftpdlib is a Python FTP server library that allows developers to create custom FTP servers with ease.

The vulnerability can lead to a denial of service (daemon outage) in applications that use pyftpdlib. An attacker can exploit the race condition by establishing and immediately closing a TCP connection.

Yes, updating pyftpdlib to version 0.5.1 or later fixes the vulnerability. It is recommended to update the library as soon as possible.

If updating pyftpdlib is not immediately feasible, developers can implement proper synchronization mechanisms in the affected code to mitigate the race condition. The provided code example demonstrates the use of a lock for synchronization.

No, this vulnerability (CVE-2009-5010) is distinct from CVE-2010-3494, although they both affect pyftpdlib.

Related vulnerabilities

Recent vulnerabilities recorded for pyftpdlib.

How To Fix

Minimum fixed version

0.5.1

This is the first release that contains the fix.

pip install --upgrade "pyftpdlib==0.5.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback