CVE-2009-5010: Pyftpdlib Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-mpg6-rgp4-35rr
CWE-362
Published
Advisory Summary

CVE-2009-5010 is a MODERATE remote code execution vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Pyftpdlib libraries in the PyPI ecosystem. The issue involves concurrent execution using shared resource with improper synchronization ('race condition') in pyftpdlib. Remediation is available by upgrading affected packages to version 0.5.1.

CVE-2009-5010 at a Glance

CVE Identifier CVE-2009-5010
GHSA Identifier GHSA-mpg6-rgp4-35rr
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Pyftpdlib
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2009-5010

To remediate this vulnerability, upgrade all affected Pyftpdlib dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pyftpdlib fixed: 0.5.1
pip install pyftpdlib>=0.5.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pyftpdlib

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2009-5010, inspect your installed packages using pip:

pip show pyftpdlib

Analyze the terminal output to locate any version of Pyftpdlib in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.1), your application is affected.

Note: The pip show pyftpdlib command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In Pyftpdlib, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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 to the accept function having an unexpected return value of None, a different vulnerability than CVE-2010-3494.

CVE-2009-5010 Affected Pyftpdlib Versions

1 component(s)
Fixed Versions:
0.5.1
Product / Package Ecosystem Affected Versions Fixed Version
pyftpdlib
PyPI
< 0.5.1
0.5.1

References

Frequently Asked Questions

What is CVE-2009-5010?
CVE-2009-5010 is a security vulnerability in Pyftpdlib involving Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') in pyftpdlib under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Pyftpdlib versions are affected?
Affected versions include releases prior to 0.5.1 across affected packages: pyftpdlib.
What version fixes CVE-2009-5010?
Upgrading to 0.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pyftpdlib affected?
Yes, pyftpdlib is affected in releases prior to 0.5.1. Upgrade your dependency to 0.5.1 or later.
What CWE is associated with CVE-2009-5010?
CVE-2009-5010 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check PyPI dependencies for CVE-2009-5010?
Run the dependency tree command: 'pip show pyftpdlib'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mpg6-rgp4-35rr",
  "modified" : "2024-10-14T17:00:43Z",
  "published" : "2022-05-02T04:00:27Z",
  "aliases" : [ "CVE-2009-5010" ],
  "summary" : "Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') in pyftpdlib",
  "details" : "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 to the accept function having an unexpected return value of None, a different vulnerability than CVE-2010-3494.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pyftpdlib"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.5.0"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2009-5010"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.launchpad.net/zodb/+bug/135108"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/giampaolo/pyftpdlib"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pyftpdlib/PYSEC-2010-7.yaml"
  }, {
    "type" : "WEB",
    "url" : "http://bugs.python.org/issue6706"
  }, {
    "type" : "WEB",
    "url" : "http://code.google.com/p/pyftpdlib/issues/detail?id=91"
  }, {
    "type" : "WEB",
    "url" : "http://code.google.com/p/pyftpdlib/source/browse/trunk/HISTORY"
  }, {
    "type" : "WEB",
    "url" : "http://code.google.com/p/pyftpdlib/source/detail?r=439"
  }, {
    "type" : "WEB",
    "url" : "http://code.google.com/p/pyftpdlib/source/diff?spec=svn439&r=439&format=side&path=/trunk/pyftpdlib/ftpserver.py"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2010/09/09/6"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2010/09/11/2"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2010/09/22/3"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2010/09/24/3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-17T22:23:26Z",
    "nvd_published_at" : "2010-10-19T20:00:00Z"
  }
}