Highlights
Cryptographic Issues: 1 prior fix. Scrutinize any change in this area.
src/pyotp/__init__.py: most-fixed (2 issues). Treat as high-risk during review.
0 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns
The bug types that recur here, drawn from past fixes, not open vulnerabilities.
Timing Attack: The use of standard short-circuiting equality comparisons for verifying one-time passwords allowed attackers to brute-force tokens by analyzing verification timing variations. Developers must enforce constant-time string comparisons for all token verification pathways.
Weak Cryptographic Key: Generating default secrets with insufficient length compromised the cryptographic strength of the tokens. Ensuring a minimum base32 key length (yielding at least 128 to 160 bits of entropy) is vital to preventing offline brute-force attacks on generated secrets.
Denial of Service: Providing a custom hashing function that yields an unexpected digest size smaller than 18 bytes triggers an unhandled IndexError during byte extraction. Robust input validation must verify digest output lengths before token slicing.