Dev.to Security 🔐 Cybersecurity 👁 2 📖 2 min read

CVE-2026-144387: CVE-2026-144387: Local Denial of Service via Unbounded Generation Log Probing in Python filelock

CVE-2026-144387: Local Denial of Service via Unbounded Generation Log Probing in Python filelock Vulnerability ID: CVE-2026-144387 CVSS Score: 3.3 Published: 2026-12-04 CVE-2026-144387 (GHSA-j77v-qg7h-37qr) is an al

CVE-2026-144387: Local Denial of Service via Unbounded Generation Log Probing in Python filelock

Vulnerability ID: CVE-2026-144387
CVSS Score: 3.3
Published: 2026-12-04

CVE-2026-144387 (GHSA-j77v-qg7h-37qr) is an algorithmic denial-of-service vulnerability affecting the Python filelock package prior to version 4.3.0. A local attacker with write access to a SoftReadWriteLock or AsyncSoftReadWriteLock generation directory can continuously append valid snapshot records, trapping lock contenders in an unbounded probing loop that bypasses configured acquisition timeouts and consumes excessive CPU resources.

TL;DR

An unbounded probing loop in filelock's SoftReadWriteLock generation log mechanism allows a local user with write access to the lock directory to bypass acquisition timeouts and trigger excessive CPU utilization. Upgrade to filelock 4.3.0 or later to resolve the issue.

Technical Details

  • CVE / GHSA ID: CVE-2026-144387 / GHSA-j77v-qg7h-37qr
  • Weakness Class: CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
  • CVSS v3.1 Score: 3.3 (LOW) - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
  • Affected Component: filelock (SoftReadWriteLock / AsyncSoftReadWriteLock GenerationLog)
  • Attack Vector: Local filesystem write access to the lock generation directory (gen/)
  • Primary Impact: Acquisition timeout overrun and local CPU exhaustion (Denial of Service)
  • EPSS / KEV Status: 0.28% (21.51st Percentile) / Not Listed in CISA KEV
  • Patched Version: filelock 4.3.0

Affected Systems

  • tox-dev/filelock (PyPI: filelock)
  • filelock: < 4.3.0 (Fixed in: 4.3.0)

Code Analysis

Commit: 6f0f71d

Bound SoftReadWriteLock generation log probe and release retries (#981)

diff --git a/src/filelock/_soft_rw/_protocol.py b/src/filelock/_soft_rw/_protocol.py
index 310946ec1..bb675d867 100644
--- a/src/filelock/_soft_rw/_protocol.py
+++ b/src/filelock/_soft_rw/_protocol.py
@@ -246,9 +246,11 @@ class GenerationLog:
     def _probe(self, start: Snapshot, patience: int = _RETAINED_GENERATIONS) -> Snapshot:
         latest = start
         generation = start.generation
+        limit = generation + 2 * _RETAINED_GENERATIONS
         gap = 0
-        while gap < patience:
+        # A writer can keep adding records; the caller checks its deadline only after this probe returns.
+        while gap < patience and generation < limit:
             generation += 1
             if (snapshot := self._read(generation)) is None:
                 gap += 1

Mitigation Strategies

  • Upgrade the Python filelock package to version 4.3.0 or later to enforce bounded generation log scanning and release deadlines.
  • Isolate lock directories from untrusted local accounts by placing lock files in directories with restrictive permissions (chmod 0700 or 0750).
  • Avoid creating SoftReadWriteLock or AsyncSoftReadWriteLock instances directly within shared world-writable directories such as /tmp or /var/tmp.

Remediation Steps:

  1. Identify all Python environments, virtualenvs, and container images using filelock versions prior to 4.3.0 (pip show filelock).
  2. Update dependency specifications in requirements.txt, pyproject.toml, or Poetry/Pipfile lockfiles to require filelock>=4.3.0.
  3. Deploy the updated package via pip install --upgrade "filelock>=4.3.0".
  4. Audit application exception handling around SoftReadWriteLock.release() and AsyncSoftReadWriteLock.release() to account for potential SoftFileLockProtocolError exceptions under extreme contention.
  5. Verify filesystem permissions on directories hosting .lock files and gen/ folders to ensure non-privileged local users cannot write arbitrary generation snapshots.

References

Read the full report for CVE-2026-144387 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.