Commit Graph
3 Commits
Author SHA1 Message Date
Jash Ambaliya bcc175a559 fix: ZM_AUTH_HASH_TTL of 0 means 2 hours on the web side, as it does in zms and zmu refs #8366 (#8367) 2026-11-26 17:56:55 -05:00
Nic Boet c687bddf5a test: stub logFingerprint() for getAuthUser() in the auth hash compare test
getAuthUser() logs a fingerprint of the auth hash instead of the hash
(ZM\logFingerprint() from log_redact.php). The test evaluates
getAuthUser() in its own namespace with stub loggers, so it needs that
function stubbed too.
2026-11-01 10:28:15 -05:00
Nic BoetandClaude Opus 5.5 16ffaa5384 fix: compare the auth hash with hash_equals() in getAuthUser()
getAuthUser() compared the auth= hash a client presents with the one it
builds using ==. When both strings look like numbers PHP compares them as
numbers, so a computed md5 of the form 0e<digits> equalled any other
0e<digits> string (and "00"), and == also returns at the first byte that
differs. hash_equals() compares the bytes in constant time.

A hash of that form comes up about once in 3*10^8 user-hours, so this is
hardening; ordinary hashes compare exactly as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 18:57:14 -05:00