http4k misleading HmacSha256.hash naming leads to unkeyed digest usage

Severity: high · CVSS 8.2 · Published 2026-06-19

The http4k library contained a misleadingly named function that could lead developers to believe they were using a secure, keyed message authentication code (HMAC) when they were actually using a plain, unkeyed hash. If a developer relied on this function to verify the authenticity of data, an attacker could potentially forge messages because no secret key was actually being used for protection. This could lead to unauthorized data modification or bypass of security checks in applications using the library.

Technologies: Http4k-Core. Vendors: Http4k, Maven.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
High severity, with a CVSS score of 8.2, published 19 June 2026.
Which products and versions are affected?
Http4k-Core < 6.49.0.0; org.http4k:http4k-core (Maven) < 6.49.0.0.
Is there a fix for This vulnerability?
A patch was published on 2026-06-19. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run Http4k-Core or org.http4k:http4k-core (Maven) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The `HmacSha256.hash(payload)` function in http4k-core was misleadingly named, as it implemented a plain unkeyed SHA-256 digest rather than a keyed Hash-based Message Authentication Code (HMAC). While the class also provided a correctly implemented `hmacSHA256(key, data)` function, the existence of the unkeyed `hash` function under the `Hmac` prefix creates a risk of developer error (CWE-345). If used for message authentication, an attacker could generate valid digests for arbitrary payloads since no secret key is involved in the calculation. The vulnerability is addressed in version 6.49.0.0 by deprecating the misleading class and introducing explicit `Sha256.hash` and `Sha256.hmac` methods.

Affected products

  • http4k http4k-core < 6.49.0.0

Timeline

  • 2026-06-16: disclosed
  • 2026-06-19: advisory
  • 2026-06-19: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.