Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

codahale/bcrypt-ruby
master @ deb496e
3
Fixes
1
CVEs
HIGH
Peak severity
0.0%
Coverage
Highlights
Auth Bypass: 1 prior fix. Scrutinize any change in this area.
lib/bcrypt/password.rb: most-fixed (2 issues). Treat as high-risk during review.
2 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.

Memory Corruption: Native C extensions interface directly with the Ruby Garbage Collector; failure to properly protect input arguments (such as keys and salts) allows the GC to prematurely reclaim memory during hashing, leading to memory corruption or crashes.
Auth Bypass: Weak validation of bcrypt hashes using line-anchored regexes (^ and $) instead of string-anchored regexes (\A and \z) allows attackers to craft payloads that bypass hash format integrity checks.
Timing Attack: Using standard string equality operators (==) to compare user-provided inputs against valid bcrypt hashes leaks timing information, allowing attackers to iteratively guess hashes.