CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
900 CVEs have CWE-367 as their primary weakness. 6 of them are in the CISA KEV catalog. The highest EPSS score among them is 82.629%.
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.
Child of CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization
Mitigations
- 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.
- 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.
- Architecture and Design: Limit the interleaving of operations on files from multiple processes.
- 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.
- Implementation: Recheck the resource after the use call to verify that the action was taken appropriately.
- Architecture and Design: Ensure that some environmental locking mechanism can be used to protect resources effectively.
- 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.
Observed examples
- CVE-2015-1743: TOCTOU in sandbox process allows installation of untrusted browser add-ons by replacing a file after it has been verified, but before it is executed
- CVE-2003-0813: Chain: A multi-threaded race condition (CWE-367) allows attackers to cause two threads to process the same RPC request, which causes a use-after-free (CWE-416) in one thread
- CVE-2004-0594: PHP flaw allows remote attackers to execute arbitrary code by aborting execution before the initialization of key data structures is complete.
- CVE-2008-2958: Chain: time-of-check time-of-use (TOCTOU) race condition in program allows bypass of protection mechanism that was designed to prevent symlink attacks.
- CVE-2008-1570: Chain: time-of-check time-of-use (TOCTOU) race condition in program allows bypass of protection mechanism that was designed to prevent symlink attacks.
Top released CVEs
KEV first, then the highest EPSS score, the highest CVSS score and the newest.
| CVE | Published | Severity | CVSS | EPSS | Description |
|---|---|---|---|---|---|
| CVE-2024-30088 | 2024-06-11 | HIGH | 7.0 | 68.202% | Windows Kernel Elevation of Privilege Vulnerability |
| CVE-2023-35311 | 2023-07-11 | HIGH | 8.8 | 15.522% | Microsoft Outlook Security Feature Bypass Vulnerability |
| CVE-2026-119977 | 2026-10-31 | HIGH | 8.1 | 1.586% | WordPress Core is vulnerable to Remote Code Execution in versions 4.7 through 7.1.3. This is due to predictable, web-accessible staging paths used during… |
| CVE-2025-22224 | 2025-03-04 | CRITICAL | 9.3 | 1.561% | VMware ESXi, and Workstation contain a TOCTOU (Time-of-Check Time-of-Use) vulnerability that leads to an out-of-bounds write. A malicious actor with local… |
| CVE-2025-38352 | 2025-07-22 | HIGH | 7.8 | 1.357% | In the Linux kernel, the following vulnerability has been resolved: posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() If… |
| CVE-2022-48618 | 2024-01-09 | HIGH | 7.0 | 0.487% | The issue was addressed with improved checks. This issue is fixed in macOS Ventura 13.1, watchOS 9.2, iOS 16.2 and iPadOS 16.2, tvOS 16.2. An attacker with… |
| CVE-2026-115690 | 2026-11-16 | not scored | 0.155% | Apache WSS4J remembers the UsernameToken Nonce, the Timestamp and signature of a signed message, and the ID of a SAML 2.0 "OneTimeUse" assertion, so that a… | |
| CVE-2026-130615 | 2026-11-17 | HIGH | 7.1 | not scored | Flowise through 3.1.4 contains a server-side request forgery vulnerability that allows authenticated users to reach internal services by exploiting unpinned… |
| CVE-2026-130385 | 2026-11-17 | LOW | 3.1 | not scored | Weblate 2026.11 through 2026.11.2 contains a time-of-check time-of-use race condition in the GET /api/tasks/{pk}/ endpoint that exposes unredacted repository… |
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-367'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-367'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).