SiteShadow
Back to vulnerability library

RACE01 Race Condition (TOCTOU)

What this means

SiteShadow flagged a "time-of-check / time-of-use" pattern where the code checks something (like file existence/permissions) and then uses it later, giving an attacker a window to swap or modify the target.

Why it matters

Attackers can change the file between check and use.

Safer examples

1) Use atomic file operations

Open/create with flags that guarantee the check and the use happen together (library/OS dependent).

2) Avoid "check then act" on paths you don't control

Prefer working with file descriptors/handles, not re-resolving paths repeatedly.

3) Use safe temp file patterns

Use platform helpers that create unique files securely rather than manual naming.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage