CyberKit

Race Condition

Also called TOCTOU.

A timing flaw between check and use that an attacker abuses.

What it is

A flaw where the security of an operation depends on the timing of events, classically a gap between when a resource is checked and when it is used (time-of-check to time-of-use). An attacker changes the resource in that window.

Why it matters

Race conditions enable privilege escalation and bypass of validation that looked correct in isolation. They are intermittent and timing-dependent, making them hard to reproduce and easy to overlook in review.

In practice

A program verifies a file path is safe, then opens it a moment later, and the attacker swaps the path for a symlink to a sensitive file in between.

What to look for

  • Time of check to time of use gaps in file or permission checks.
  • Bugs that only reproduce under load.
  • Temp files created with predictable names.

Common mistake

Testing once and calling it fixed. Races need repeated, parallel testing.

Practice it nearby

CyberKit has no tool for this term itself. These are the closest places to practice it.

Read next

Sources