{"id":"GHSA-q7pg-9pr4-mrp2","summary":"httpsig-rs: HMAC verification is vulnerable to timing attack","details":"### Summary\nHMAC signature comparison is not timing-safe and is vulnerable to timing attacks.\n\n### Details\n`SharedKey::sign()` returns a `Vec\u003cu8\u003e` which has a non-constant-time equality implementation.\n\n`Hmac::finalize()` returns a constant-time wrapper ([`CtOutput`](https://docs.rs/digest/0.10.7/digest/struct.CtOutput.html)) which was discarded. Alternatively, `Hmac` has a constant-time `verify()` method.\n\nThe problem reported here is due to the following lines in `SharedKey::sign()` of the previous code:\n```rust\nlet mut mac = HmacSha256::new_from_slice(key).unwrap();\nmac.update(data);\nOk(mac.finalize().into_bytes().to_vec())\n```\nand the merged update changes the third line to directly verify with `verify_slice`.\n\n### Impact\n\nAnyone who uses HS256 signature verification is vulnerably to Timing Attack that allows the attacker to forge a signature.","aliases":["CVE-2025-59058"],"modified":"2025-09-12T22:13:24.081949Z","published":"2025-09-12T21:11:13Z","database_specific":{"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2025-09-12T21:11:13Z","nvd_published_at":"2025-09-12T14:15:41Z","cwe_ids":["CWE-208"]},"references":[{"type":"WEB","url":"https://github.com/junkurihara/httpsig-rs/security/advisories/GHSA-q7pg-9pr4-mrp2"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59058"},{"type":"WEB","url":"https://github.com/junkurihara/httpsig-rs/commit/fc095b6ce6043bb808f5d9c4379cf697899cb458"},{"type":"PACKAGE","url":"https://github.com/junkurihara/httpsig-rs"}],"affected":[{"package":{"name":"httpsig","ecosystem":"crates.io","purl":"pkg:cargo/httpsig"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.0.19"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-q7pg-9pr4-mrp2/GHSA-q7pg-9pr4-mrp2.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"}]}