---
schema_version: '1.0'
id: security-20261029-b9220f
title: 'CVE-2026-112936: filelock: ReadWriteLock follows a symlink at the lock path
  into SQLite'
url: https://osv.dev/vulnerability/GHSA-j8f7-rjxc-mr56
url_hash: b9220fd96d9adad55feacec8fc1c7a2134d0dec05a6e250b2f251a0d270e00e8
canonical_url: https://osv.dev/vulnerability/GHSA-j8f7-rjxc-mr56
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-112936
- GHSA-j8f7-rjxc-mr56
- severity:CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
- filelock
- PyPI
lang: en
published_at: '2026-10-28T21:08:30Z'
fetched_at: '2026-10-29T12:25:39.424374Z'
updated_at: '2026-10-29T14:58:31Z'
status: published
content_hash: 64a21ca08caddc9911a180834d416e7fa57c65e3b7323f24d8ea33a3cb6f10a9
content_changed_at: null
license_note: full
summary: 'filelock: ReadWriteLock follows a symlink at the lock path into SQLite'
summary_source: rss
summary_en: 'filelock: ReadWriteLock follows a symlink at the lock path into SQLite'
summary_omitted_reason: null
redistribution: true
keywords_en:
- CVE
- CVE-2026-112936
- filelock
- follows
- GHSA-j8f7-rjxc-mr56
- into
- library vulnerability
- lock
- path
- PyPI
- PyPIのBrotliパッケージ
- ReadWriteLock
- severity:CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
- software security
- SQLite
- symlink
- the
- THE MARK GRAND HOTEL
entities_en:
- name: CVE
  type: concept
- name: PyPIのBrotliパッケージ
  type: organization
- name: THE MARK GRAND HOTEL
  type: artifact
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: concept
- name: PyPIのBrotliパッケージ
  type: organization
- name: THE MARK GRAND HOTEL
  type: artifact
key_facts: []
related: []
related_auto:
- name: Go
  type: programminglanguage
  weight: 1.0
- name: ジェノア対ユヴェントス
  type: event
  weight: 1.0
- name: じゃらんなら会員制プラン
  type: concept
  weight: 1.0
computed_at: '2026-10-29T14:58:19Z'
---

# CVE-2026-112936: filelock: ReadWriteLock follows a symlink at the lock path into SQLite

## TL;DR
filelock: ReadWriteLock follows a symlink at the lock path into SQLite

## Key Points
- cve / CVE-2026-112936 / GHSA-j8f7-rjxc-mr56 / severity:CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L / filelock / PyPI

## Details
**Severity:** CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
**Advisory:** GHSA-j8f7-rjxc-mr56 (CVE-2026-112936)

**Details:**
### Summary

`ReadWriteLock` and `AsyncReadWriteLock` resolve the lock path with `pathlib.Path.resolve()` and pass it to `sqlite3.connect()` without refusing a symlink. A local user who can create names in the lock's directory, such as `/tmp` or a shared cache, can plant a symlink at the lock path and make the victim's process create, lock, or write the file it points to, or break mutual exclusion between the victim's own processes.

### Details

`ReadWriteLock.__init__` stores `pathlib.Path(lock_file).resolve()`, which follows a final symlink, and every connection opens that path through `sqlite3.connect()` with no `O_NOFOLLOW` or regular-file check. SQLite's own VFS also resolves the final symlink in user space, so `fs.protected_symlinks` and the sticky bit do not help: the kernel never sees a symlink to refuse. The other lock classes do not follow a final symlink: `FileLock` opens with `O_NOFOLLOW`, and `SoftReadWriteLock` coordinates through `<path>.rw/`.

### Proof of concept

On Linux, with the victim and attacker as different users and `/shared` mode 1777 with `fs.protected_symlinks=1`:

1. The attacker runs `ln -s /home/victim/private/pwned.flag /shared/app.rwlock.db`.
2. The victim constructs `ReadWriteLock("/shared/app.rwlock.db")`. A plain `os.open(..., O_NOFOLLOW)` on the same path fails, but the lock creates `/home/victim/private/pwned.flag`, owned by the victim, inside a directory the attacker cannot write.
3. With `/shared/cache.rwlock.db -> /shared/a.db`, one victim process holds the write lock. The attacker repoints the link to `/shared/b.db`, and a second victim process acquires the write lock while the first still holds it.

The same behavior reproduces on macOS, on Windows 11, and through `AsyncReadWriteLock`.

### Impact

A local attacker with write access to the lock directory can make the victim create empty files it owns at paths the attacker cannot write, make the victim hold a SQLite lock on another application's database so that application gets `database is locked`, and give two victim processes the write lock at once, letting them corrupt the resource the lock protects.

### Workarounds

Keep `ReadWriteLock` paths in directories that only trusted users can write.

**References:**
- https://github.com/tox-dev/filelock/security/advisories/GHSA-j8f7-rjxc-mr56
- https://nvd.nist.gov/vuln/detail/CVE-2026-112936
- https://github.com/tox-dev/filelock/commit/4d45e83caf7e31f9a12fb44526bdc07f70114f04
- https://github.com/tox-dev/filelock
- https://github.com/tox-dev/filelock/releases/tag/4.0.9

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-j8f7-rjxc-mr56_

## Source
元記事: [CVE-2026-112936: filelock: ReadWriteLock follows a symlink at the lock path into SQLite](https://osv.dev/vulnerability/GHSA-j8f7-rjxc-mr56) — published 2026-10-28T21:08:30Z
