Bootstrap token comparison is not constant-time #72
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Info
Severity: HIGH
Attack vector: network-only
Impact
Allows an attacker on the same network segment to recover the bootstrap token and register a malicious user agent.
Description
The bootstrap token is compared using normal Rust
Stringequality, which short-circuits on the first mismatching byte. That creates a timing side channel that leaks how much of the supplied token prefix matches the expected value.Example flow
Mitigation
Replace the comparison with a constant-time equality function such as
subtle::ConstantTimeEq.