GitHub Advisoryadvisory · crates.io
GHSA-q7pg-9pr4-mrp2 httpsig-rs: HMAC verification is vulnerable to timing attack
MEDIUM
Official page ↗
- Aliases
- CVE-2025-59058
- Ecosystem
- crates.io
- Packages
- httpsig
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
- Weaknesses
- CWE-208
- Reviewed
- 2025-09-12
Affected packages
• crates.io httpsig: < 0.0.19 → fixed in 0.0.19
Description
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.
The problem reported here is due to the following lines in `SharedKey::sign()` of the previous code:
```rust
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.
Related
Alias · CVE (1)
- CVE-2025-59058 httpsig-rs is a Rust implementation of IETF RFC 9421 http message signatures. vulnerability
Weakness · CWE (1)
- CWE-208 Observable Timing Discrepancy weakness