Skip to content
uencoder

Race Condition

A race condition is multiple threads concurrently accessing shared resources where interleaved execution produces unexpected states, which can be exploited to bypass checks.

Purpose

To understand security-check bypasses caused by concurrency races and their defenses; a common defect in multi-threaded programs.

Mechanism

TOCTOU: the window between check and use can be exploited by an attacker (e.g., after the program checks a file exists, the attacker replaces it with a symlink). Defenses: atomic operations, locks, file descriptors.

Use cases

  • Concurrency security audit
  • TOCTOU vulnerabilities
  • Multi-threaded defects

Related tools

References