SiteShadow
Back to vulnerability library
Detected byPro-tier static analysisPro

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

Catch this with SiteShadow Pro.

This vulnerability class is detected by SiteShadow's Pro-tier engines, two-pass interprocedural taint analysis, heuristic flow checks, AI-context scanning, and cross-file detection. The free tier catches OWASP Top 10 single-file patterns; Pro adds the data-flow depth that finds this class of bug.