This vulnerability occurs when a system compares sensitive data, like passwords or authentication tokens, piece-by-piece instead of as a complete unit. If the comparison stops at the first mismatch, attackers can measure tiny timing differences to gradually guess the correct value.
Developers often implement comparison logic—for passwords, MACs, or challenge responses—by checking each character or byte individually and exiting early when a mismatch is found. This "short-circuit" behavior creates a detectable timing side-channel: each incorrect guess takes slightly longer to fail as more characters match. An attacker can exploit this by systematically trying different values and analyzing response times to reconstruct the secret, piece by piece. To prevent this, always use constant-time comparison functions that process the entire input regardless of content. These functions ensure the comparison takes the same amount of time whether it succeeds or fails, eliminating the timing side-channel. Never roll your own comparison for security-critical data; rely on vetted library functions designed to resist timing attacks.
Impact: Bypass Protection Mechanism