timing attack

An attack that works out secret information by measuring how long an operation takes.

Comparing secrets with === can let an attacker recover a token or signature byte by byte.

In more detail

An ordinary string comparison stops at the first differing character, so a response that takes slightly longer reveals that more leading characters were right. Repeating this lets an attacker guess a token one character at a time.

Related terms

Taught in

References