CVE-2025-59058: httpsig-rs: HMAC verification is vulnerable to timing attack
Summary HMAC signature comparison is not timing-safe and is vulnerable to timing attacks. Details SharedKey::sign() returns a Vec which has a non-constant-time equality implementation. Hmac::finalize() returns a constant-time wrapper (CtOutput) which was discarded. Alternatively, Hmac has a constant-time verify() method.
Published Sep 12, 2025
Affected packages
httpsig
- Ecosystem
- Rust (crates.io)
- Affected
- < 0.0.19
- Fixed in
- 0.0.19
- Check
cargo tree -i httpsig
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
HMAC signature comparison is not timing-safe and is vulnerable to timing attacks.
Details
SharedKey::sign() returns a Vec<u8> which has a non-constant-time equality implementation.
Hmac::finalize() returns a constant-time wrapper (`CtOutput`) which was discarded. Alternatively, Hmac has a constant-time verify() method.
The problem reported here is due to the following lines in SharedKey::sign() of the previous code:
let mut mac = HmacSha256::new_from_slice(key).unwrap();
mac.update(data);
Ok(mac.finalize().into_bytes().to_vec())and the merged update changes the third line to directly verify with verify_slice.
Impact
Anyone who uses HS256 signature verification is vulnerably to Timing Attack that allows the attacker to forge a signature.
Credited to rasendubi.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
