Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-367 (检查时间与使用时间(TOCTOU)的竞争条件) — Vulnerability Class 325

325 vulnerabilities classified as CWE-367 (检查时间与使用时间(TOCTOU)的竞争条件). AI Chinese analysis included.

CWE-367 represents a logic flaw where a system verifies a resource’s state before accessing it, allowing the state to change maliciously between the verification and actual usage. Attackers typically exploit this race condition by manipulating the resource, such as swapping a file or altering permissions, during the narrow window between the check and the use. This enables unauthorized access or privilege escalation, as the application proceeds based on outdated, validated assumptions. To mitigate this vulnerability, developers must ensure atomic operations, ensuring that the check and use occur simultaneously without interruption. Implementing robust locking mechanisms, utilizing secure system calls that combine verification and access, or adopting file descriptor-based approaches can effectively prevent state changes, thereby eliminating the race condition and securing the resource against temporal manipulation.

MITRE CWE Description
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.
Common Consequences (6)
Integrity, OtherAlter Execution Logic, Unexpected State
The attacker can gain access to otherwise unauthorized resources.
Integrity, OtherModify Application Data, Modify Files or Directories, Modify Memory, Other
Race conditions such as this kind may be employed to gain read or write access to resources which are not normally readable or writable by the user in question.
Integrity, OtherOther
The resource in question, or other resources (through the corrupted one), may be changed in undesirable ways by a malicious user.
Non-RepudiationHide Activities
If a file or other resource is written in this method, as opposed to in a valid way, logging of the activity may not occur.
Non-Repudiation, OtherOther
In some cases it may be possible to delete files a malicious user might not otherwise have access to, such as log files.
Mitigations (5)
ImplementationThe 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.
ImplementationWhen 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 DesignLimit the interleaving of operations on files from multiple processes.
Implementation, Architecture and DesignIf 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.
ImplementationRecheck the resource after the use call to verify that the action was taken appropriately.
Examples (2)
The following code checks a file, then updates its contents.
struct stat *sb; ... lstat("...",sb); // it has not been updated since the last time it was read printf("stated file\n"); if (sb->st_mtimespec==...){ print("Now updating things\n"); updateThings(); }
Bad · C
The following code is from a program installed setuid root. The program performs certain file operations on behalf of non-privileged users, and uses access checks to ensure that it does not use its root privileges to perform operations that should otherwise be unavailable the current user. The program uses the access() system call to check if the person running the program has permission to access…
if(!access(file,W_OK)) { f = fopen(file,"w+"); operate(f); ... } else { fprintf(stderr,"Unable to open file %s.\n",file); }
Bad · C
CVE IDTitleCVSSSeverityPublished
CVE-2024-45120 Adobe Commerce | Time-of-check Time-of-use (TOCTOU) Race Condition (CWE-367) — Adobe Commerce 3.1 Low2024-10-10
CVE-2024-47813 Wasmtime race condition could lead to WebAssembly control-flow integrity and type safety violations — wasmtime 2.9 Low2024-10-09
CVE-2024-43511 Windows Kernel Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.0 High2024-10-08
CVE-2024-5803 Local privelage escalation via COM hijacking — Antivirus 7.5 High2024-10-03
CVE-2024-0133 NVIDIA Container Toolkit 安全漏洞 — Container Toolkit 4.1 Medium2024-09-26
CVE-2024-0132 NVIDIA Container Toolkit 安全漏洞 — Container Toolkit 9.0 Critical2024-09-26
CVE-2024-6787 MXview One Series vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition — MXview One Series 5.3 Medium2024-09-21
CVE-2024-27114 Remote Code Execution through File Upload in SOPlanning before 1.52.02 — SO Planning 8.1AIHighAI2024-09-11
CVE-2024-39420 Acrobat Reader | Time-of-check Time-of-use (TOCTOU) Race Condition (CWE-367) — Acrobat Reader 7.0 High2024-08-14
CVE-2024-39425 Security vulnerability in AdobeARMHelper — Acrobat Reader 7.0 High2024-08-14
CVE-2024-38186 Windows Kernel-Mode Driver Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.8 High2024-08-13
CVE-2024-38153 Windows Kernel Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.8 High2024-08-13
CVE-2024-7348 PostgreSQL relation replacement during pg_dump executes arbitrary SQL — PostgreSQL 8.8 High2024-08-08
CVE-2024-30471 Apache StreamPipes: Potential creation of multiple identical accounts — Apache StreamPipes 7.4AIHighAI2024-07-17
CVE-2024-39821 Zoom Workplace App for Windows and Zoom Rooms App for Windows - Race Condition — Zoom Workplace App for Windows and Zoom Rooms App for Windows 6.6 Medium2024-07-15
CVE-2024-39826 Zoom Workplace Apps and SDKs - Path traversal — Zoom Workplace Apps and SDKs 6.8 Medium2024-07-15
CVE-2024-27238 Zoom Apps and SDKs - Race Condition — Zoom Apps and SDKs 7.1 High2024-07-15
CVE-2024-0171 Dell PowerEdge Server BIOS 安全漏洞 — PowerEdge Platform 5.3 Medium2024-06-25
CVE-2024-5558 Schneider Electric SpaceLogic AS-P 安全漏洞 — SpaceLogic AS-P 6.4 Medium2024-06-12
CVE-2024-35265 Windows Perception Service Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.0 High2024-06-11
CVE-2024-30099 Windows Kernel Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.0 High2024-06-11
CVE-2024-30088 Windows Kernel Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.0 High2024-06-11
CVE-2024-30084 Windows Kernel-Mode Driver Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.0 High2024-06-11
CVE-2024-3292 Race Condition — Nessus Agent 8.2 High2024-05-17
CVE-2024-3290 Race Condition — Nessus 8.2 High2024-05-17
CVE-2024-28137 PHOENIX CONTACT: privilege escalation due to a TOCTOU vulnerability in the CHARX Series — CHARX SEC-3000 7.8 High2024-05-14
CVE-2024-2913 Race Condition Vulnerability in mintplex-labs/anything-llm — mintplex-labs/anything-llm 3.7AILowAI2024-05-06
CVE-2023-33119 Time-of-check Time-of-use (TOCTOU) Race Condition in Hypervisor — Snapdragon 8.4 High2024-05-06
CVE-2023-32156 Tesla Model 3 Gateway Firmware Signature Validation Bypass Vulnerability — Model 3 6.8 -2024-05-03
CVE-2023-27327 Parallels Desktop Toolgate Time-Of-Check Time-Of-Use Local Privilege Escalation Vulnerability — Desktop 7.5 -2024-05-03

Vulnerabilities classified as CWE-367 (检查时间与使用时间(TOCTOU)的竞争条件) represent 325 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.