Christophe Vila 0e3295b746 fix(auth): stop flipLastChar's tamper tests from flaking
Corrupting the true last character of a JWT's base64url-encoded
HMAC-SHA256 signature is unreliable: that character encodes only 4
real bits plus 2 unused padding bits, and Go's encoding/base64
ignores those padding bits by default -- about 1 in 4 replacement
characters decode to byte-identical signature bytes, so the
"tampered" cookie still verifies and the test spuriously passes.
Corrupting the second-to-last character instead is deterministic,
since HMAC-SHA256's fixed 32-byte digest length means that position
is always fully significant.

Confirmed via 20 repeated runs (previously ~1/3 failure rate).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 10:59:49 +02:00
2026-07-27 06:37:25 +02:00
2026-07-26 12:00:00 +02:00
2026-07-26 12:00:00 +02:00
Description
No description provided
1.5 MiB
Languages
Go 72.8%
TypeScript 20.3%
Python 4.7%
CSS 2.1%