SiteShadow
Back to vulnerability library
Detected byStatic analysis

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 in your code with SiteShadow.

Every released SiteShadow scanner is free, including full project analysis, reports, patterns, dashboard access, and configured organization SSO.