Advisory

GHSA-q7pg-9pr4-mrp2

Also known as: CVE-2025-59058

Summary

httpsig-rs: HMAC verification is vulnerable to timing attack

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2025-09-12 21:11 UTC
Modified
2025-09-12 22:13 UTC

Affected packages and fixes

httpsig

crates.io · All systems

Affected

  • introduced 0, fixed 0.0.19 (semver)

Fixed versions

0.0.19

Fix

  • Fixed version 0.0.19
    cargo update -p httpsig --precise 0.0.19

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences