Race Condition
- •
def
- •
a bug where the outcome depends on the timing of two things happening at (or near) the same time, when that timing wasn't properly planned for
- •
- •
classic form
- •
time-of-check to time-of-use (TOCTOU) — checking a condition, then having something change between the check and when the result of that check is actually used
- •
- •
example
- •
two users simultaneously transferring 100 account, if the system doesn't validate balances properly between the check and the transfer, can result in more money leaving the account than it ever held
- •
- •
- •
related
- •