You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(security): replace bcrypt pepper concatenation with HMAC-SHA256 pre-hashing
Bcrypt silently truncates input at 72 bytes. Concatenating key_secret (64
chars) with a pepper could push the combined string past that limit, causing
the tail characters to be ignored — two distinct secrets could produce the
same hash.
Fix: _apply_pepper() now computes HMAC-SHA256(pepper, secret), producing a
fixed 32-byte digest that is always well within bcrypt's input limit. The
pepper remains cryptographically bound to the secret as the HMAC key.
This is a breaking change: hashes stored under the old concatenation scheme
will not verify with the new implementation; affected keys must be re-issued.
Also updates README, docs/index.md, and docs/schema.mermaid to document the
NIST SP 800-132 compliance entry, the OWASP API2:2023 bullet (missing from
docs/index.md), the STATE_CHECK node (missing from the docs/index.md diagram),
and the NOTE_ARGON annotation to cover both Argon2 and Bcrypt strategies.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
0 commit comments