KEVWire

Security intelligence, with context.

Response snapshot Oct 29, 2026, 03:36 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-112912

filelock: Symlink swap during SoftFileLock's writability check leaks whether a path exists and is writable by the lock taker

raise_on_not_writable_file() is the check that SoftFileLock and the locks sharing its acquire path run before every attempt. It looks at the lock path with os.lstat, so that it judges a planted symlink (a file that points at another path) by itself.

At a glance

Exploited
Not known
Severity
2.5 Low (CVSS 3.1)
Chance of exploitation
0.2% in the next 30 days
Sources
1 source

What to do

GitHub lists first patched versions: filelock: 4.2.1. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-9j6q-wvj5-jgjg (opens a new tab)

What happened

raise_on_not_writable_file() is the check that SoftFileLock and the locks sharing its acquire path run before every attempt. It looks at the lock path with os.lstat, so that it judges a planted symlink (a file that points at another path) by itself. When the node has no owner-write bit, it then calls os.access(filename, os.W_OK), which follows symlinks.

A local user who can create entries in the lock's directory can swap the path between a mode-0466 file and a symlink to a path of their choosing. The second call then reports on the symlink's target with the permissions of the user running the lock (below: the lock user).

The lock user's acquire() ends in PermissionError within a fraction of a second when the target is missing or not writable by the lock user, and in the ordinary Timeout otherwise.

That yields one bit per watched acquire. The bit says whether a path exists and is writable by the lock taker. It covers paths under directories the other user cannot search, or any path when root takes the lock. The lock does not open, create or modify anything through the symlink. On Linux, fs.

Continue reading

protected_symlinks (a kernel setting that refuses to follow another user's symlink in a sticky world-writable directory) blocks it in a directory such as /tmp. It does not block it in a 0777 directory without the sticky bit (a directory flag that lets only a file's owner remove or rename it) or in a sticky group-writable one. This reopens the leak PR #567 closed. Affected versions are filelock 3.32.6 through 4.2.0.

Anthropic's OSS Scanner reported this in private. Finding covered by this advisory:

- ANT-2026-RQ91AXTW [medium, CWE-59]: Symlink TOCTOU in raise_on_not_writable_file leaks file existence.

Severity

CVSS 3.1 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N scores 2.5 (Low).

AV:L (local): the other user needs an account on the same host. PR:L (low privileges): an ordinary account is enough. UI:N (no user interaction). AC:H (high attack complexity): the swap has to land between two system calls a few bytecodes apart (6 to 12 % of back-to-back acquires with the other user on a second CPU, 1 in 8 000 on one CPU), and the other user has to observe how the lock user's acquire ended.

C:L (partial confidentiality impact): one bit per acquire (existence or writability of a chosen path), no content. I:N and A:N (no integrity or availability impact). S:U (scope unchanged).

Classification from the review: security, conditional, "a one-bit probe of a victim-only path" that "Linux protected symlinks block in the common sticky /tmp case, but not every shared directory". The scanner rated this medium. The maintainers score it low for the complexity and the one-bit yield.

Scope and preconditions

- The affected classes are SoftFileLock and everything that reuses its _acquire: MarkerSoftFileLock, SoftFileLease, the async soft locks, and FileLock after an ENOSYS fallback to a soft lock. UnixFileLock itself does not call the helper. WindowsFileLock._acquire() does, but on Windows os.access reads the link's own read-only attribute and does not follow it; that branch did not run.

- The other user must be able to create entries in the lock's directory. With Linux defaults (fs.protected_symlinks=1) the kernel refuses the lock user's attempt to follow another user's symlink in a directory that is both sticky and world-writable. /tmp therefore gives PermissionError for every target and leaks nothing.

A 0777 directory without the sticky bit, or a sticky group-writable one (1770 with a shared group), has no such cover and leaks as described. macOS and the BSDs have no fs.protected_symlinks, and a symlink there has mode bits of its own, so one without the owner-write bit would reach os.access with no swap at all (not executed). - The swap is practical only with a second CPU for the other user.

- The other user needs to see how the lock user's acquire ended, for example the exception in a shared log, an exit status, or when the job stopped (PermissionError ends a blocking acquire within about a second; the other case runs to its timeout). The scanner also observed a variant that needs no output from the lock user.

Hold the soft lock, set the marker (the lock file whose presence says a process holds the lock) to mode 0o066, swap the symlink in and out for a few seconds, release, and see whether a marker owned by the other uid appears. A contender still waiting takes the lock; one that raised is gone. - The O_NOFOLLOW open that follows the check is not affected.

The lock does not read, create or modify anything through the symlink.

Affected code

Scanned commit b831496b0273: in raise_on_not_writable_file, the [os.lstat that states the invariant](https://github.com/tox-dev/filelock/blob/b831496b0273ecd11bf02b8d080ca8b673a538c1/src/filelock/_util.py#L46-L50) and the [os.access call that follows symlinks](https://github.com/tox-dev/filelock/blob/b831496b0273ecd11bf02b8d080ca8b673a538c1/src/filelock/_util.py#L63-L71); the [call from SoftFileLock.

_acquire](https://github.com/tox-dev/filelock/blob/b831496b0273ecd11bf02b8d080ca8b673a538c1/src/filelock/_soft.py#L63) at the start of every poll.

Introduced

[f2f7b86](https://github.com/tox-dev/filelock/commit/f2f7b8696426) "fix: respect ACL write access when the owner write bit is absent" ([#728](https://github.com/tox-dev/filelock/pull/728), 2026-09-08), first tag 3.32.6 (verified), appended the os.access call to the not S_IWUSR test. [#567](https://github.com/tox-dev/filelock/pull/567) (022394c, first tag 3.29.5) had changed the helper from os.stat to os.

lstat so that a symlink planted at the lock path could not probe its target.

Mechanism

SoftFileLock._acquire calls the helper first, once per poll_interval (0.05 s by default) for as long as the lock user waits. The helper runs os.lstat(path). When the node has no S_IWUSR it runs `os.access(path,

Affected package ranges reported by GitHub: filelock: >= 3.32.6, <= 4.2.0

Scores and how they were measured

CVSS base severity

2.5

Version 3.1As of

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

0.2%

Scored Percentile 11.7%

Model and measurement source (opens a new tab)

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-9j6q-wvj5-jgjg (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-9j6q-wvj5-jgjg, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  3. Primary source

    FIRST measured EPSS score (opens a new tab)

    Measured EPSS probability and percentile for CVE-2026-112912, scored 2026-10-28. This is a model estimate, not proof of exposure.

    Published Checked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, October 28). filelock: Symlink swap during SoftFileLock's writability check leaks whether a path exists and is writable by the lock taker (CVE-2026-112912). https://kevwire.com/record/CVE-2026-112912

MLA

"filelock: Symlink swap during SoftFileLock's writability check leaks whether a path exists and is writable by the lock taker (CVE-2026-112912)." KEVWire, 28 Oct. 2026, kevwire.com/record/CVE-2026-112912.

Chicago

KEVWire. "filelock: Symlink swap during SoftFileLock's writability check leaks whether a path exists and is writable by the lock taker (CVE-2026-112912)." Last modified October 28, 2026. https://kevwire.com/record/CVE-2026-112912.

Evidence summary (plain text)

filelock: Symlink swap during SoftFileLock's writability check leaks whether a path exists and is writable by the lock taker (Oct 28, 2026).
raise_on_not_writable_file() is the check that SoftFileLock and the locks sharing its acquire path run before every attempt. It looks at the lock path with os.lstat, so that it judges a planted symlink (a file that points at another path) by itself. When the node has no owner-write bit, it then calls os.access(filename, os.W_OK), which follows symlinks. A local user who can create entries in the lock's directory can swap the path between a mode-0466 file and a symlink to a path of their choosing.
CVSS 2.5 (version 3.1; evidence as of Oct 28, 2026; https://github.com/advisories/GHSA-9j6q-wvj5-jgjg).
EPSS 0.2% for the following 30 days, scored Oct 28, 2026 (https://api.first.org/data/v1/epss?cve=CVE-2026-112912&date=2026-10-28).
Sources:
GitHub-reviewed advisory GHSA-9j6q-wvj5-jgjg: https://github.com/advisories/GHSA-9j6q-wvj5-jgjg
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
FIRST measured EPSS score: https://api.first.org/data/v1/epss?cve=CVE-2026-112912&date=2026-10-28
Record ID: CVE-2026-112912.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Oct 29, 2026, 02:16 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are coming as part of KEVWire Premium: join the waitlist. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail