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

854 results · Feed

  • High 7.0

    Rsync < 3.4.3 TOCTOU Race Condition Allows Symlink-Based Arbitrary File Write

    Rsync versions before 3.4.3 contain a time-of-check to time-of-use (TOCTOU) race condition in daemon file handling that allows attackers to redirect file writes outside intended directories by replacing parent directory components with symbolic links. Attacke…

  • Medium 6.3

    Rsync < 3.4.3 Symlink Race Condition via Path-Based Syscalls

    Rsync version 3.4.2 and prior contain symlink race condition vulnerabilities in path-based system calls including chmod, lchown, utimes, rename, unlink, mkdir, symlink, mknod, link, rmdir, and lstat that allow local attackers to redirect operations to files o…

  • High 7.8

    TOCTOU local privilege escalation vulnerability

    VMware Fusion contains a TOCTOU (Time-of-check Time-of-use) vulnerability that occurs during an operation performed by a SETUID binary. A malicious actor with local non-administrative user privileges may exploit this vulnerability to escalate privileges to ro…

  • Low 2.0

    A race condition in the MxGPU-Virtualization driver’s ioctl path caused by concurrent unsynchronized access to the glob…

  • Low 1.8

    A TOCTOU (Time-Of-Check to Time-Of-Use) in the graphics interface may allow an attacker to load registers repeatedly cr…

  • Medium 5.3

    Gotenberg: DNS rebinding bypasses SSRF validation on Chromium URL conversion routes

    Gotenberg is a Docker-powered stateless API for PDF files. Prior to 8.32.0, FilterOutboundURL resolves the hostname, checks the resolved IPs against the private-address deny-list, and returns only the error. It discards the resolved addresses. Chromium later …

  • Medium 5.0

    csync2 uses insecure temporary directories when compiled with C99 or later

    csync2 uses insecure temporary directories when compiled with C99 or later, allowing for TOCTOU style attacks on the temporary directories.

  • High 7.8

    Windows Cloud Files Mini Filter Driver Elevation of Privilege Vulnerability

    Use after free in Windows Cloud Files Mini Filter Driver allows an authorized attacker to elevate privileges locally.

  • Medium 6.3

    FastGPT: DNS rebinding TOCTOU bypass in isInternalAddress allows SSRF on all protected endpoints

    FastGPT is an AI Agent building platform. In versions 4.14.11 and prior, FastGPT's isInternalAddress() function in packages/service/common/system/utils.ts is vulnerable to DNS rebinding (TOCTOU — Time-of-Check to Time-of-Use). The function resolves the hostna…

  • High 7.2

    n8n-MCP: Authenticated SSRF in n8n-mcp webhook and API client paths

    n8n-MCP is an MCP server that provides AI assistants access to n8n node documentation, properties, and operations. From version 2.18.7 to before version 2.50.2, there is an authenticated server-side request forgery vulnerability affecting the webhook trigger …

  • Medium 6.5

    Apache CloudStack: Domain/account resources limits not honored

    Due to multiple time-of-check time-of-use race conditions in the resource count check and increment logic, as well as missing validations, users of the platform are able to exceed the allocation limits configured for their accounts/domains. This can be used b…

  • High 7.8

    The socket connection handler in aswArPot.sys in the Avast and AVG Windows Anti Rootkit driver before 22.1 allows local…

  • High 7.4

    Akamai Guardicore Platform Agent (GPA) and Zero Trust Client on Linux and macOS allow TOCTOU-based local privilege esca…

  • High 7.4

    Spring Cloud Config Server Susceptible To TOCTOU Attack

    The base directory (`spring.cloud.config.server.git.basedir`) used by the Spring Cloud Config Server to clone Git repositories to is susceptible to time-of-check-time-of-use (TOCTOU) attacks. Spring Cloud Config 3.1.x: affected from 3.1.0 through 3.1.13 (incl…

  • High 7.7

    OpenClaw < 2026.4.22 - Time-of-Check/Time-of-Use Race Condition in OpenShell FS Bridge

    OpenClaw before 2026.4.22 contains a time-of-check/time-of-use race condition in the OpenShell filesystem bridge that allows attackers to read files outside the intended mount root. Attackers can exploit symlink swaps during filesystem operations to bypass sa…

  • Critical 9.6

    OpenClaw < 2026.4.22 - Symlink Swap Race Condition in OpenShell FS Bridge Writes

    OpenClaw before 2026.4.22 contains a time-of-check/time-of-use race condition in OpenShell sandbox filesystem writes that allows attackers to redirect writes outside the intended mount root. Attackers can exploit symlink swaps during filesystem operations to …

  • Medium 6.3

    OpenClaw < 2026.4.10 - DNS Rebinding SSRF via Hostname Validation Bypass

    OpenClaw before 2026.4.10 contains a server-side request forgery vulnerability in browser navigation policy that allows attackers to bypass hostname validation through DNS rebinding attacks. Attackers can exploit inconsistent hostname resolution between valid…

  • Medium 5.4

    Sandboxie-Plus local privilege escalation via TOCTOU race condition in UpdUtil addon installation

    Sandboxie-Plus is an open source sandbox-based isolation software for Windows. In versions 1.17.2 and earlier, a Time-of-Check-to-Time-of-Use (TOCTOU) race condition exists during addon installation. When a user installs an addon through the SandMan interface…

  • Low 2.6

    chatchat-space Langchain-Chatchat OpenAI-Compatible File Upload API openai_routes.py files toctou

    A vulnerability has been found in chatchat-space Langchain-Chatchat up to 0.3.1.3. Impacted is the function files of the file libs/chatchat-server/chatchat/server/api_server/openai_routes.py of the component OpenAI-Compatible File Upload API. Such manipulatio…

  • Low 2.5

    OpenClaw < 2026.4.10 - Time-of-Check-Time-of-Use (TOCTOU) Race Condition in exec Script Preflight Validator

    OpenClaw before 2026.4.10 contains a time-of-check-time-of-use vulnerability in the validateScriptFileForShellBleed function that allows local attackers to bypass workspace boundary checks. An attacker with workspace write access can race-condition swap the t…

  • Medium 4.1

    PaperCut MF: Card truncation on HP readers

    A race condition exists in PaperCut MF when processing badge-swipe data from certain HP multifunction devices. Under specific network conditions involving dropped packets and out-of-order sequence counters, the server may incorrectly process fragmented data c…

  • High 7.8
    CVE-2026-7791 Public exploit

    Local Privilege Escalation via TOCTOU Race Condition in Amazon WorkSpaces Skylight Agent

    Improper privilege management in the log rotation mechanism of the Skylight Workspace Config Service in Amazon WorkSpaces for Windows before 2.6.2034.0 allows a local non-admin authenticated user to place arbitrary files into arbitrary locations bypassing fil…

  • High 7.8

    Time-of-check Time-of-use (TOCTOU) Race Condition in DSP Service

    Memory corruption while creating a process on the digital signal processor due to allocation failure at the kernel level.

  • Medium 5.0

    PrefectHQ prefect Webhook/Notification validate_restricted_url toctou

    A vulnerability has been found in PrefectHQ prefect up to 3.6.28.dev1. Affected by this vulnerability is the function validate_restricted_url of the component Webhook/Notification. The manipulation leads to time-of-check time-of-use. It is possible to initiat…

  • High 7.8

    net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()

    In the Linux kernel, the following vulnerability has been resolved: net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd() In tpacket_snd(), when PACKET_VNET_HDR is enabled, vnet_hdr points directly into the mmap'd TX ring buffer shared with userspac…

  • Critical 9.8

    AGL app-framework-main thru 17.1.12 contains a Zip Slip path traversal vulnerability (CWE-22) combined with a TOCTOU ra…

  • Medium 6.5

    Wazuh: API brute-force protection bypass via race condition in login attempt tracking

    Wazuh is a free and open source platform used for threat prevention, detection, and response. From version 4.0.0 to before version 4.14.4, Wazuh's server API brute-force protection for POST /security/user/authenticate can be bypassed by sending concurrent aut…

  • Medium 6.7

    OpenClaw < 2026.4.2 - Approval Integrity Bypass in pnpm dlx Local Script Binding

    OpenClaw before 2026.4.2 contains an approval integrity vulnerability in pnpm dlx that fails to bind local script operands consistently with pnpm exec flows. Attackers can replace approved local scripts before execution without invalidating the approval plan,…

  • Medium 5.3

    OpenClaw < 2026.3.31 - Callback Origin Mutation in Plivo Voice-call Replay

    OpenClaw before 2026.3.31 contains a callback origin mutation vulnerability in Plivo voice-call replay that allows attackers to mutate in-process callback origin before replay rejection. Attackers with captured valid callbacks for live calls can exploit this …

  • Medium 5.0

    OpenClaw < 2026.3.31 - Time-of-Check-Time-of-Use (TOCTOU) Vulnerability in Sandbox File Operations

    OpenClaw before 2026.3.31 contains a time-of-check-time-of-use vulnerability in sandbox file operations that allows attackers to bypass fd-based defenses. Attackers can exploit check-then-act patterns in apply_patch, remove, and mkdir operations to manipulate…

  • High 7.1

    Flowise: SSRF Protection Bypass (TOCTOU & Default Insecure)

    Flowise is a drag & drop user interface to build a customized large language model flow. Prior to 3.1.0, the core security wrappers (secureAxiosRequest and secureFetch) intended to prevent Server-Side Request Forgery (SSRF) contain multiple logic flaws. These…

  • Medium 4.5

    uutils coreutils chcon Security Bypass and Mandatory Access Control (MAC) Inconsistency via TOCTOU Race Condition

    A Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the chcon utility of uutils coreutils during recursive operations. The implementation resolves recursive targets using a fresh path lookup (via fts_accpath) rather than binding the traversal and …

  • Medium 6.3

    uutils coreutils split Arbitrary File Truncation via Time-of-Check to Time-of-Use (TOCTOU) Race Condition

    A Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the split utility of uutils coreutils. The program attempts to prevent data loss by checking for identity between input and output files using their file paths before initiating the split operati…

  • Medium 6.3

    uutils coreutils mv Arbitrary File Overwrite via Cross-Device TOCTOU Race Condition

    A Time-of-Check to Time-of-Use (TOCTOU) race condition exists in the mv utility of uutils coreutils during cross-device operations. The utility removes the destination path before recreating it through a copy operation. A local attacker with write access to t…

  • Low 3.6

    uutils coreutils Missing TOCTOU Protection on Non-Linux Unix Platforms in Safe Traversal Module

    The safe_traversal module in uutils coreutils, which provides protection against Time-of-Check to Time-of-Use (TOCTOU) symlink races using file-descriptor-relative syscalls, is incorrectly limited to Linux targets. On other Unix-like systems such as macOS and…

  • Medium 6.3

    uutils coreutils touch Arbitrary File Truncation via TOCTOU Race Condition

    The touch utility in uutils coreutils is vulnerable to a Time-of-Check to Time-of-Use (TOCTOU) race condition during file creation. When the utility identifies a missing path, it later attempts creation using File::create(), which internally uses O_TRUNC. An …

  • Medium 4.7

    uutils coreutils cp Information Disclosure via Time-of-Check to Time-of-Use Symlink Swap

    A Time-of-Check to Time-of-Use (TOCTOU) vulnerability in the cp utility of uutils coreutils allows an attacker to bypass no-dereference intent. The utility checks if a source path is a symbolic link using path-based metadata but subsequently opens it without …

  • Medium 4.7

    uutils coreutils cp Information Disclosure via Permission Handling Race

    The cp utility in uutils coreutils is vulnerable to an information disclosure race condition. Destination files are initially created with umask-derived permissions (e.g., 0644) before being restricted to their final mode (e.g., 0600) later in the process. A …

  • Medium 6.3

    uutils coreutils install Arbitrary File Overwrite with -D via Path Component Symlink Race

    A Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the install utility of uutils coreutils when using the -D flag. The command creates parent directories and subsequently performs a second path resolution to create the target file, neither of whi…

  • Medium 6.3

    uutils coreutils install Arbitrary File Overwrite via Symlink TOCTOU Race

    The install utility in uutils coreutils is vulnerable to a Time-of-Check to Time-of-Use (TOCTOU) race condition during file installation. The implementation unlinks an existing destination file and then recreates it using a path-based operation without the O_…