Skip to content
OpenAdvisories

Weakness (CWE)

CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition

Base Incomplete

The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.

How to prevent it (7 mitigations)
  1. Implementation

    The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. This does not resolve the underlying issue of the execution of a function on a resource whose state and identity cannot be assured, but it does help to limit the false sense of security given by the check.

  2. Implementation

    When the file being altered is owned by the current user and group, set the effective gid and uid to that of the current user and group when executing this statement.

  3. Architecture and Design

    Limit the interleaving of operations on files from multiple processes.

  4. Implementation, Architecture and Design

    If you cannot perform operations atomically and you must share access to the resource between multiple processes or threads, then try to limit the amount of time (CPU cycles) between the check and use of the resource. This will not fix the problem, but it could make it more difficult for an attack to succeed.

  5. Implementation

    Recheck the resource after the use call to verify that the action was taken appropriately.

  6. Architecture and Design

    Ensure that some environmental locking mechanism can be used to protect resources effectively.

  7. Implementation

    Ensure that locking occurs before the check, as opposed to afterwards, such that the resource, as checked, is the same as it is when in use.

Source: MITRE CWE-367

856 results · Feed

  • Medium 5.6

    Apport race condition in crash report permissions

    Time-of-check Time-of-use Race Condition vulnerability on crash report ownership change in Apport allows for a possible privilege escalation opportunity. If fs.protected_symlinks is disabled, this can be exploited between the os.open and os.chown calls when t…

  • Medium 5.3

    Insufficient Session Expiration and TOCTOU Race Condition in OPC FOundation UA .Net Standard

    This vulnerability allows remote attackers to create a denial-of-service condition on affected installations of OPC Foundation UA .NET Standard 1.04.358.30. Authentication is not required to exploit this vulnerability. The specific flaw exists within the hand…

  • Medium 5.0

    Junos OS: Privilege escalation vulnerability in dual REs, VC or HA cluster may allow unauthorized configuration change.

    A privilege escalation vulnerability in Juniper Networks Junos OS devices configured with dual Routing Engines (RE), Virtual Chassis (VC) or high-availability cluster may allow a local authenticated low-privileged user with access to the shell to perform unau…

  • Medium 6.2

    race condition on texlive-filesystem cron job allows for the deletion of unintended files

    A Race Condition Enabling Link Following vulnerability in the cron job shipped with texlive-filesystem of SUSE Linux Enterprise Module for Desktop Applications 15-SP1, SUSE Linux Enterprise Software Development Kit 12-SP4, SUSE Linux Enterprise Software Devel…

  • Medium 4.9

    race condition in the packaging of texlive-filesysten

    A Race Condition Enabling Link Following vulnerability in the packaging of texlive-filesystem of SUSE Linux Enterprise Module for Desktop Applications 15-SP1, SUSE Linux Enterprise Software Development Kit 12-SP4, SUSE Linux Enterprise Software Development Ki…

  • High 8.2

    This vulnerability allows local attackers to escalate privileges on affected installations of Parallels Desktop 15.1.2-…

  • Medium 5.9

    TOCTOU Race Condition in Yarn

    The package integrity validation in yarn < 1.19.0 contains a TOCTOU vulnerability where the hash is computed before writing a package to cache. It's not computed again when reading from the cache. This may lead to a cache pollution attack.

  • Unscored —

    Prior to 0.1, all builds of Eclipse OMR contain a bug where the loop versioner may fail to privatize a value that is pu…

  • Medium 6.5

    Apport contains a TOCTTOU vulnerability when reading the users ~/.apport-ignore.xml

    Apport before versions 2.14.1-0ubuntu3.29+esm1, 2.20.1-0ubuntu2.19, 2.20.9-0ubuntu7.7, 2.20.10-0ubuntu27.1, 2.20.11-0ubuntu5 contained a TOCTTOU vulnerability when reading the users ~/.apport-ignore.xml file, which allows a local attacker to replace this file…

  • Unscored —

    All builds of Eclipse OpenJ9 prior to 0.15 contain a bug where the loop versioner may fail to privatize a value that is…

  • Medium —

    devise Time-of-check Time-of-use Race Condition vulnerability

    Plataformatec Devise version 4.5.0 and earlier, using the lockable module contains a CWE-367 vulnerability in The `Devise::Models::Lockable` class, more specifically at the `#increment_failed_attempts` method. File location: lib/devise/models/lockable.rb that…

  • Medium 5.0

    A flaw was found in qemu Media Transfer Protocol (MTP). The code opening files in usb_mtp_get_object and usb_mtp_get_pa…

  • Low 3.9
    CVE-2018-1121 Public exploit

    procps-ng, procps is vulnerable to a process hiding through race condition. Since the kernel's proc_pid_readdir() retur…

  • Medium 5.1

    fts.c in coreutils 8.4 allows local users to delete arbitrary files.

  • High 7.4
    CVE-2015-3246 Exploited Public exploit

    libuser before 0.56.13-8 and 0.60 before 0.60-7, as used in the userhelper program in the usermode package, directly mo…

    KEV Aug 26, 2026
  • High 8.4

    dxgkrnl.sys in the kernel-mode drivers in Microsoft Windows Vista SP2, Windows Server 2008 SP2 and R2 SP1, and Windows …