Executive brief
Http4s is an HTTP server library that implements Digest Authentication to protect API endpoints from unauthorized access. A flaw in its replay-attack defense allows an attacker who observes a single authenticated request to replay it multiple times, potentially making unauthorized state-changing requests (e.g., fund transfers, data modifications) as if they were from a legitimate user. This defeats the core security benefit that Digest Authentication provides over simpler Basic Authentication.
Technical details
The DigestAuth implementation in Http4s stores `lastNc + 1` (one more than the last seen nonce-count) instead of the actual `nc` value it just accepted. When legitimate clients send non-contiguous `nc` values—such as during parallel or retried requests, which browsers commonly do—the server's counter lags behind the highest `nc` seen. This allows a passive network observer to capture a single `Authorization` header and replay it multiple times before the server's counter catches up, bypassing the replay protection mechanism. The attack requires no authentication privileges and network accessibility but does require observing legitimate traffic. Patched versions are 0.23.35 for the 0.23.x branch and 1.0.0-M47 for the 1.0.0-M branch.
Affected products
- Http4s http4s-ember-core <= 0.23.34 (fixed in 0.23.35); 1.0.0-M1 to 1.0.0-M46 (fixed in 1.0.0-M47)
Timeline
- 2026-07-06: disclosed
- 2026-09-15: advisory: Published to GitHub Advisory Database