Threaticon
Toggle sidebar

You're viewing a limited, public preview. Log in for full access.

Log in User Guide
Log in Get started
Attack Patterns CAPEC-29 — Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions
CAPEC-29

Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions

TLP:CLEAR

Description

Typical severity: High. Likelihood of attack: High. This attack targets a race condition occurring between the time of check (state) for a resource and the time of use of a resource. A typical example is file access. The adversary can leverage a file access race condition by "running the race", meaning that they would modify the resource between the first time the target program accesses the file and the time the target program uses the file. During that period of time, the adversary could replace or modify the file, causing the application to behave unexpectedly.

Mitigation

Use safe libraries to access resources such as files. | Be aware that improper use of access function calls such as chown(), tempfile(), chmod(), etc. can cause a race condition. | Use synchronization to control the flow of execution. | Use static analysis tools to find race conditions. | Pay attention to concurrency problems related to the access of resources.

Details

Platforms
Software
Added
Jul 14, 2026
Leaving Threaticon

This link opens an external site that isn't part of the platform.