Skip to content
Heist/ feed
Back to feed
MediumFix available

python-filelock — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2026-22701

filelock is a platform-independent file lock for Python. Prior to version 3.20.3, a TOCTOU race condition vulnerability exists in the SoftFileLock implementation of the filelock package. An attacker with local filesystem access and permission to create symlinks can exploit a race condition between the permission validation and file creation to cause lock operations to fail or behave unexpectedly. The vulnerability occurs in the _acquire() method between raise_on_not_writable_file() (permission check) and os.open() (file creation). During this race window, an attacker can create a symlink at the lock file path, potentially causing the lock to operate on an unintended target file or leading to denial of service. This issue has been patched in version 3.20.3.

Products
python-filelock
Affected versions
2.0.11-1, 2.0.12-1, 2.0.13-1, 3.0.0-2, 3.0.12-2, 3.0.3-1, 3.0.4-1, 3.12.2-1, 3.12.4-1, 3.13.1-1, 3.18.0-1, 3.20.0-1, 3.20.2-1, 3.20.3-1, 3.29.4-1, 3.3.2-1, 3.32.0-1, 3.32.2-1, 3.4.0-1, 3.4.2-1, 3.4.2-2, 3.6.0-1
Fixed versions
3.0.4-1ubuntu0.1~esm1, 3.13.1-1ubuntu0.1~esm1, 3.6.0-1ubuntu0.1~esm1
CVEs
CVE-2026-22701
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 02:57 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-22701

core-osv · Original source

Published 10 Jan 2026, 06:15 UTC

filelock is a platform-independent file lock for Python. Prior to version 3.20.3, a TOCTOU race condition vulnerability exists in the SoftFileLock implementation of the filelock package. An attacker with local filesystem access and permission to create symlinks can exploit a race condition between the permission validation and file creation to cause lock operations to fail or behave unexpectedly. The vulnerability occurs in the _acquire() method between raise_on_not_writable_file() (permission check) and os.open() (file creation). During this race window, an attacker can create a symlink at the lock file path, potentially causing the lock to operate on an unintended target file or leading to denial of service. This issue has been patched in version 3.20.3.

osv:UBUNTU-CVE-2026-22701

python-filelock

Fixed versions: 3.0.4-1ubuntu0.1~esm1

python-filelock

Fixed versions: 3.6.0-1ubuntu0.1~esm1

python-filelock

Fixed versions: 3.13.1-1ubuntu0.1~esm1

python-filelock

Fixed versions: Not specified

python-filelock

Fixed versions: Not specified

python-filelock

Fixed versions: Not specified

Complete source record
{
  "id": "b2b4e3433b622d7a7095b0b9b0b022d8f130f566e8083bf0b71a66bf75f5aa0a",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-22701",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-22701",
    "summary": "filelock is a platform-independent file lock for Python. Prior to version 3.20.3, a TOCTOU race condition vulnerability exists in the SoftFileLock implementation of the filelock package. An attacker with local filesystem access and permission to create symlinks can exploit a race condition between the permission validation and file creation to cause lock operations to fail or behave unexpectedly. The vulnerability occurs in the _acquire() method between raise_on_not_writable_file() (permission check) and os.open() (file creation). During this race window, an attacker can create a symlink at the lock file path, potentially causing the lock to operate on an unintended target file or leading to denial of service. This issue has been patched in version 3.20.3.",
    "evidence": "osv:UBUNTU-CVE-2026-22701",
    "products": [
      {
        "name": {
          "value": "python-filelock",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.0.4-1ubuntu0.1~esm1",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "2.0.11-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.0.12-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.0.13-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.0.0-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.0.3-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.0.4-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "python-filelock",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.6.0-1ubuntu0.1~esm1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "3.0.12-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.2-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.4.0-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.4.2-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.4.2-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.6.0-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "python-filelock",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.13.1-1ubuntu0.1~esm1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "3.12.2-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.12.4-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.13.1-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "python-filelock",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.18.0-1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "python-filelock",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.20.3-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.29.4-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.32.0-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.32.2-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "python-filelock",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.18.0-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.20.0-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.20.2-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.20.3-1",
            "evidence": "/affected/5/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2026-22701",
      "aliases": [
        "UBUNTU-CVE-2026-22701"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.0.4-1ubuntu0.1~esm1"
                }
              ]
            }
          ],
          "package": {
            "name": "python-filelock",
            "purl": "pkg:deb/ubuntu/python-filelock?arch=source&distro=esm-apps%2Fbionic",
            "ecosystem": "Ubuntu:Pro:18.04:LTS"
          },
          "versions": [
            "2.0.11-1",
            "2.0.12-1",
            "2.0.13-1",
            "3.0.0-2",
            "3.0.3-1",
            "3.0.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-22701.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python-filelock",
                "binary_version": "3.0.4-1ubuntu0.1~esm1"
              },
              {
                "binary_name": "python3-filelock",
                "binary_version": "3.0.4-1ubuntu0.1~esm1"
              }
            ],
            "availability": "Available with Ubuntu Pro: https://ubuntu.com/pro"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.6.0-1ubuntu0.1~esm1"
                }
              ]
            }
          ],
          "package": {
            "name": "python-filelock",
            "purl": "pkg:deb/ubuntu/python-filelock?arch=source&distro=esm-apps%2Fjammy",
            "ecosystem": "Ubuntu:Pro:22.04:LTS"
          },
          "versions": [
            "3.0.12-2",
            "3.3.2-1",
            "3.4.0-1",
            "3.4.2-1",
            "3.4.2-2",
            "3.6.0-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-22701.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-filelock",
                "binary_version": "3.6.0-1ubuntu0.1~esm1"
              }
            ],
            "availability": "Available with Ubuntu Pro: https://ubuntu.com/pro"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.13.1-1ubuntu0.1~esm1"
                }
              ]
            }
          ],
          "package": {
            "name": "python-filelock",
            "purl": "pkg:deb/ubuntu/python-filelock?arch=source&distro=esm-apps%2Fnoble",
            "ecosystem": "Ubuntu:Pro:24.04:LTS"
          },
          "versions": [
            "3.12.2-1",
            "3.12.4-1",
            "3.13.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-22701.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-filelock",
                "binary_version": "3.13.1-1ubuntu0.1~esm1"
              }
            ],
            "availability": "Available with Ubuntu Pro: https://ubuntu.com/pro"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "python-filelock",
            "purl": "pkg:deb/ubuntu/python-filelock?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "3.18.0-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-22701.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-filelock",
                "binary_version": "3.18.0-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "python-filelock",
            "purl": "pkg:deb/ubuntu/python-filelock?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "3.20.3-1",
            "3.29.4-1",
            "3.32.0-1",
            "3.32.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-22701.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-filelock",
                "binary_version": "3.32.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "python-filelock",
            "purl": "pkg:deb/ubuntu/python-filelock?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "3.18.0-1",
            "3.20.0-1",
            "3.20.2-1",
            "3.20.3-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-22701.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python3-filelock",
                "binary_version": "3.20.3-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:59:54.993274042Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-22701"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-22701",
        "https://www.cve.org/CVERecord?id=CVE-2026-22701",
        "https://github.com/tox-dev/filelock/security/advisories/GHSA-qmgc-5h2g-mvrw",
        "https://github.com/tox-dev/filelock/commit/255ed068bc85d1ef406e50a135e1459170dd1bf0",
        "https://github.com/tox-dev/filelock/commit/41b42dd2c72aecf7da83dbda5903b8087dddc4d5",
        "https://ubuntu.com/security/notices/USN-7999-1"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-22701",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 359952,
  "published_at": "2026-01-10T06:15:00+00:00"
}