Time of Check (TOCTOU)
Time-of-check (TOC) is the first half of a TOCTOU race: the moment the program checks resource state (e.g., file existence, permissions).
Purpose
To understand the time-window risk between check and use in TOCTOU races.
Mechanism
The program checks the condition at TOC (access(path, R_OK)) and uses the resource at TOU (open(path)). Within the window, an attacker can substitute the resource (a symlink pointing to a sensitive file).
Use cases
- Race vulnerability analysis
- File operation security
- Permission check audit