Not ratedCVE-2026-112908

    Filelock: Incorrect Permission Assignment for Critical Resource (CVE-2026-112908)

    Published Sources: OSV, Hersteller

    What is affected, what to do

    Update Filelock to version 4.2.1.

    Affected
    • Filelock *..>= 3.30.0, <= 4.2.0
    • Filelock 3.30.0..*
    • Filelock 3.30.1..*
    • Filelock 3.30.2..*
    • Filelock 3.30.3..*
    • Filelock 3.31.0..*
    • Filelock 3.31.1..*
    • Filelock 3.31.2..*
    • Filelock 3.32.0..*
    • Filelock 3.32.2..*
    • Filelock 3.32.3..*
    • Filelock 3.32.4..*
    • Filelock 3.32.5..*
    • Filelock 3.32.6..*
    • Filelock 3.32.7..*
    • Filelock 4.0.0..*
    • Filelock 4.0.1..*
    • Filelock 4.0.10..*
    • Filelock 4.0.11..*
    • Filelock 4.0.12..*
    • Filelock 4.0.2..*
    • Filelock 4.0.3..*
    • Filelock 4.0.4..*
    • Filelock 4.0.5..*
    • Filelock 4.0.6..*
    • Filelock 4.0.7..*
    • Filelock 4.0.8..*
    • Filelock 4.0.9..*
    • Filelock 4.1.0..*
    • Filelock 4.1.1..*
    • Filelock 4.1.2..*
    • Filelock 4.2.0..*
    Fixed in
    • Filelock 4.2.1

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    —

    Priority

    No value is available for this vulnerability.

    —

    CVSS v3

    No value is available for this vulnerability.

    —

    EPSS score

    No value is available for this vulnerability.

    Show all metrics
    Severity
    Not rated
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    30.00 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    no public PoC known
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    —
    Published
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-732

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    Handle the vulnerability in regular vulnerability handling under Art. 21(2)(e) NIS2.
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    From 11.12.2027, Annex I Part II CRA requires manufacturers of affected products with digital elements to handle vulnerabilities without delay and provide security updates.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

    StrictSoftFileLock and AsyncStrictSoftFileLock apply the caller's mode to the sentinel (the lock file at <path>) and to both claim files (the files whose presence says a process wants or holds the lock). They create the two directories that hold the claims, <path>.filelock and <path>.filelock/claims, with a bare mkdir(). That gives 0o777 filtered through the umask (a per-process mask that removes permission bits from new files and directories) or, under a parent with a default ACL (an access control list on a directory that sets the permissions of entries created inside it), through that ACL.

    A hold consists of two claim names in that directory, which has no sticky bit (a directory flag that lets only a file's owner remove it). When the environment leaves another local user (the other user below) a write bit on the directory, that user can unlink the holder's 0600 claims. Three settings do this: umask 000 in a sticky directory such as /tmp, umask 002 with the other user in the directory's group, or a default ACL on the lock's parent that grants the group write (the kernel then ignores the umask). After the unlink, the next contender of the holder's account finds the directory empty and enters. The first holder keeps reporting is_locked == True and later releases with no error. Affected versions: filelock >= 3.30.0 and <= 4.2.0 (finding ANT-2026-AD6SUOON).

    Severity

    CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:L, 5.3 (Medium).

    AV:L (local): the other user needs an account on the same host. AC:H (high attack complexity): the holder must pass a restrictive mode while its umask or the parent's default ACL leaves the other user a write bit on new directories, and a contender of the holder's account must ask for the lock after the claims are gone. With the common umask 022 and no default ACL the directories are 0755, and the kernel refuses the other user's unlink. PR:L (low privileges): an unprivileged account is enough. UI:N (no user interaction): the holder's processes act on their own.

    C:N (no confidentiality impact): the 0600 claim files stay unreadable. I:H (high integrity impact): two holders then write the data the lock protects, and neither learns of the other. A:L (low availability impact): the same write access lets the other user create names in claims, and an empty file named held-v1-<32 zeros>.claim makes the next acquire() raise SoftFileLockProtocolError ("malformed claim record") until someone removes it. Classification from the review: security, conditional on a lax umask or a permissive default ACL. The scanner rated it high (CWE-732).

    Scope and preconditions

    • The holder passes a restrictive mode such as 0o600. Without one, the umask decides the permissions by documented design (the "File permissions and mode" section of docs/concepts.rst defines mode only for the lock file). Umask 000 with the default mode gives the same two-holder result but is outside this finding.

    • The holder's environment leaves the other user a write bit on new directories. The scanner measured three ways, with mode=0o600 and the other user a member of group team:

      lock's parent directoryholder's umask<path>.filelock and claims/who can unlink the claims
      1777, like /tmp0000777any other local user
      root:team, 3775 (setgid, so new entries inherit the group, and sticky)0022775any member of team
      root:team, 1770, default ACL group:team:rwx (setfacl -d -m g:team:rwx)0770770any member of team
      root:team, 3775, no ACL0222755no one; the second process times out

      The default-ACL row is the strongest. A holder with a private umask and mode=0o600 still gets group-writable claim directories. The lock file in that row is 0600, because its mode reaches os.open and masks the inherited ACL.

    • A contender that may enter asks for the lock: another process of the holder's account, or root. Nothing needs planting beforehand. The holder creates and owns the whole tree, so the existing-directory branch of _ensure_protocol_directory (the subject of GHSA-9c4x-gm8v-wgc4) plays no part.

    • Directories that an affected release already created keep their mode. A 0777 <path>.filelock from an earlier run stays writable by other users after an upgrade, because filelock does not remove these directories. Upgraders should chmod or remove existing <path>.filelock trees (see Workarounds).

    • The other lock classes do not have this gap in the same setting. With umask 000 and mode=0o600, FileLock and SoftFileLock create one 0600 file and nothing else, and SoftReadWriteLock creates its directories 0700 under any umask. Platform: POSIX permission semantics; demonstrated on Linux.

    filelock's checks against another local user hold only when no other user can replace the lock's directory or any of its ancestors. That is the case when each ancestor belongs to the lock's user or root and is either not writable by others or sticky. A user who can rename entries in a non-sticky directory above the lock controls every name below it. No file-based lock can defend against that.

    Affected code

    At the scanned commit b831496, the bare mkdir() sits in _ensure_protocol_directory. StrictSoftFileLock._acquire calls it for both levels without a mode. It then passes self._open_mode() to the sentinel and, through _attempt_doorway, to both claim files. The doorway (the acquire step that scans existing claims and publishes the caller's own) proceeds when the claim scan is empty. _unlink_owner_path_result counts a missing claim name as removed on release.

    Introduced

    The bare mkdir() arrived with the claim directories in 650c17c79c54 ("feat(strict): replace shared markers with owner claims", #659, 2026-07-14), first released in 3.30.0. We checked this against the git tags. Every release since 3.30.0 has it.

    Mechanism

    A process with umask 000 that takes StrictSoftFileLock("/tmp/<dir>/x.lock", mode=0o600) leaves this on disk while it holds the lock, every entry owned by the holder:

    0600 x.lock
    0777 x.lock.filelock
    0777 x.lock.filelock/claims
    0600 x.lock.filelock/claims/held-v1-<token>.claim
    0600 x.lock.filelock/claims/intent-v1-<token>.claim
    

    Removing a name needs write permission on the directory, and these directories are not sticky. Another local user who cannot read either claim can therefore unlink both. Renaming claims/ away inside the 0777 <path>.filelock has the same effect. For this lock class the directory permissions decide who can end a hold. The sentinel at <path> is permanent and says nothing about who holds. A contender starts its doorway by listing the claim directory and proceeds when it is empty. Once the two names are gone, the next contender publishes its own intent and held claims and enters. The original holder does not notice. is_locked is its own counter, and _release removes its claims by name through _unlink_owner_path_result, which takes FileNotFoundError as "already removed". The first process therefore releases with exit status 0. No force_break(), lifetime or legacy client takes part.

    The other user's action is a plain unlink. The right to do it comes from filelock's mkdir, not from anything the application asked for. In the same setting the other user can neither read nor remove the 0600 sentinel in the sticky parent.

    Source: OSV (Open Source Vulnerabilities), GitHub Security Advisories

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    Affected versionsFixed in
    pipfilelock
    • >= 3.30.0, <= 4.2.0
    • 4.2.1
    pypifilelock
    • 3.30.2
    • 3.32.7
    • 4.0.0
    • 4.0.4
    • 3.32.3
    • 3.31.1
    • 4.2.0
    • 4.1.1
    • 3.32.0
    • 4.0.6
    • 4.0.8
    • 3.30.0
    • 4.0.11
    • 4.0.1
    • 3.31.2
    • 4.0.2
    • 4.1.2
    • 4.0.12
    • 3.30.3
    • 3.32.5
    • 3.32.6
    • 4.1.0
    • 4.0.5
    • 3.30.1
    • 4.0.7
    • 3.32.4
    • 3.31.0
    • 4.0.10
    • 3.32.2
    • 4.0.3
    • 4.0.9
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • 4.2.1
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —
    • —

    Weakness classes (CWE)

    • CWE-732Incorrect Permission Assignment for Critical Resource

      Class

      The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.

      Entry at MITRE CWE-732

    References & sources

    • github.comtox-dev/filelock/security/advisories/GHSA-6627-m3xw-93mpweb
    • github.comtox-dev/filelock/pull/839web
    • github.comtox-dev/filelock/commit/bfa066d65a1ba9106f86ee9d027f7588b9c77e03web
    • github.comtox-dev/filelockpackage
    • github.comtox-dev/filelock/releases/tag/4.2.1web
    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2026-112908
    <a href="https://intel.neosec.eu/en/cve/CVE-2026-112908"><img src="https://intel.neosec.eu/badge/cve/CVE-2026-112908.svg?lang=en" alt="CVE-2026-112908 – NEOSEC Intel" height="20"></a>