# filelock: SoftReadWriteLock follows a lock tree swapped in after its first acquire and writes lock records into directories of the user running the lock

Advisory record · `GHSA-wfhq-q4j2-c37m`

- **Identifiers:** `GHSA-wfhq-q4j2-c37m` · `CVE-2026-112941`
- **State:** Confirmed
- **Severity:** CVSS 3.3 Low
- **Critical:** No
- **Weakness (CWE):** [CWE-367](https://cwe.mitre.org/data/definitions/367.html)
- **Tags:** [Race condition](https://agentprime.io/advisories/tag/race-condition.md)
- **Published:** 28 Oct 2026
- **Updated:** 28 Oct 2026
- **Reviewed by a person:** No

Published by the GitHub Advisory Database at 28 Oct 2026, 21:09 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

## Affected packages

- `filelock` (PyPI): affected `>=4.1.0, <4.2.1`; fixed in `4.2.1`

## Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

> Affected: the PyPI package filelock, versions 4.1.0 up to but not including 4.2.1 (fixed in 4.2.1). A local user who can write the directory holding a SoftReadWriteLock path, or who created the lock's .rw tree first in a sticky directory such as /tmp, can swap in a tree whose gen or holders entry is a symbolic link into another directory. A long-running process that has already passed the one-time check then creates, renames and deletes lock-record files in that directory with its own privileges, with no race needed. Upgrade to filelock 4.2.1.

Written 31 Oct 2026.

## Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

## Severity and exploitation

- 3.3 Low, CVSS 3.1: `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N`, from CNA (GitHub_M)

- **CISA KEV:** Not listed.
- **EPSS:** 0.0013, the 2nd percentile, on 5 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

- 31 Oct 2026, 14:07 UTC: First seen by agentprime
- 31 Oct 2026, 14:07 UTC: [Confirmed by OSV](https://osv.dev/vulnerability/GHSA-wfhq-q4j2-c37m)

## Sources

- [GitHub Advisory Database: GHSA-wfhq-q4j2-c37m](https://github.com/advisories/GHSA-wfhq-q4j2-c37m)
- [OSV: GHSA-wfhq-q4j2-c37m](https://osv.dev/vulnerability/GHSA-wfhq-q4j2-c37m)
- <https://github.com/tox-dev/filelock/security/advisories/GHSA-wfhq-q4j2-c37m>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-112941>
- <https://github.com/tox-dev/filelock/pull/842>
- <https://github.com/tox-dev/filelock/commit/bfa066d65a1ba9106f86ee9d027f7588b9c77e03>
- <https://github.com/tox-dev/filelock>
- <https://github.com/tox-dev/filelock/releases/tag/4.2.1>

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.

## Check whether this affects you

A Match means an installed version is in the affected range above. Most don’t affect the app; agentprime hasn’t analysed this one yet.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), ask your agent to check the project: `check_lockfile` sends a lockfile, `check_packages` a list of installed packages, and both return the Matches and the upgrades that clear them. `get_advisory` returns this record. Setup: <https://agentprime.io/mcp.md>
- In a browser: <https://agentprime.io/check/> reads your lockfile in the browser, never uploading it.
- Whether it touches your code, with file and line: the Claude Code plugin, <https://agentprime.io/plugin.md>
- As JSON: <https://api.agentprime.io/v1/advisories/GHSA-wfhq-q4j2-c37m>, or `POST https://api.agentprime.io/v1/match` with your packages (<https://agentprime.io/api.md>)

---

The web page: <https://agentprime.io/advisories/GHSA-wfhq-q4j2-c37m/>. Everything for agents: <https://agentprime.io/llms.txt>.
