Time-of-check to time-of-use testing at the application and file-system layer — stateful windows where a value validated at check time changes before use (re-validation gaps, cached authorization decisions, file/symlink swaps, upload-then-scan gaps, payment confirmation windows). Complements race-condition with the non-HTTP and logic-window cases. Tier 1.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Toctou?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-toctou)
---
name: toctou
description: Time-of-check to time-of-use testing at the application and file-system layer — stateful windows where a value validated at check time changes before use (re-validation gaps, cached authorization decisions, file/symlink swaps, upload-then-scan gaps, payment confirmation windows). Complements race-condition with the non-HTTP and logic-window cases. Tier 1.
---
# TOCTOU (Time-of-Check / Time-of-Use)
The logic-and-filesystem cousin of race conditions: a check and the dependent use are separated in time, and the state changes between them.
## Trigger phrases
`toctou, time of check time of use, revalidation gap, symlink race, upload scan gap, cached authorization`
## Patterns to test
- **Re-validation gaps:** value checked once, trusted later (price validated at step 1, changed at step 3; permission cached in session after a role change).
- **Upload-then-process:** file passes an AV/type scan, then is swapped/moved before use; or served before scanning completes.
- **File-system (host-side, in authorized local testing):** symlink/path swap between an access check and open/write (classic SUID TOCTOU — overlaps `linux-file-path-abuse`).
- **Payment/confirmation windows:** confirm order before payment settles; change cart between authorization and capture.
- **Token/state windows:** reuse a token in the gap before invalidation.
## Method
Identify the two points (check, use), then change the underlying state in the window — via a second request, a slow upload, or a concurrent edit. Where sub-ms timing is needed, use the single-packet technique (→ `race-condition`).
## Escalation
Bypass validation/authorization, tamper price/state after approval, deliver malicious file past scanning.
## Backend
Use the preferred Kali path (native Kali / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike / Metasploit-MCP) or a headless browser for client-side steps; Windows-local only as last resort. See `zazy-orchestrator`.
## Verification (background, before reporting)
Re-confirm every candidate independently (second account/session, replay, or OAST) before marking CONFIRMED. Report true positives only; hold back anything not reproduced.
## Evidence
The two points, the state change injected in the window, and the resulting bypass.