GHSA-fm4g-76c9-7w69
Http4s: DigestAuth nonce map grows unbounded
Quick fix
GHSA-fm4g-76c9-7w69 — org.http4s:http4s-ember-server_2.12: upgrade to the fixed version with the command below.
# pom.xml: bump <version>0.23.35</version> for org.http4s:http4s-ember-server_2.12Details
The `DigestAuth` server middleware's stale-nonce cleanup uses an inverted comparison: it removes *fresh* nonces and stops at the first *stale* one. Because a new nonce is created for every unauthenticated challenge, an attacker can drive the nonce map to grow without bound until the JVM runs out of heap.
## Impact
Unauthenticated remote denial of service (gradual heap exhaustion / OOM) against any service using DigestAuth. The leak is persistent.
## Preconditions
- Application uses `DigestAuth` on at least one route.
## Workarounds
- Front the DigestAuth protected routes with a rate limiter to slow the leak. - Restart periodically.
## Fixes
- The eviction logic is corrected. - A max cache size of 1000000 is imposed to protected against a burst between evictions. This limit is not yet configurable.
Are you affected?
Enter the version of the package you're using.
Affected packages
0Fixed in: 0.23.35# pom.xml: bump <version>0.23.35</version> for org.http4s:http4s-ember-server_2.120Fixed in: 0.23.35# pom.xml: bump <version>0.23.35</version> for org.http4s:http4s-ember-server_2.130Fixed in: 0.23.35# pom.xml: bump <version>0.23.35</version> for org.http4s:http4s-ember-server_31.0.0-M1Fixed in: 1.0.0-M47# pom.xml: bump <version>1.0.0-M47</version> for org.http4s:http4s-ember-server_2.131.0.0-M1Fixed in: 1.0.0-M47# pom.xml: bump <version>1.0.0-M47</version> for org.http4s:http4s-ember-server_3References
- https://github.com/http4s/http4s/security/advisories/GHSA-fm4g-76c9-7w69[WEB]
- https://github.com/http4s/http4s/commit/8cfeda8472954d631dfbe5dc026463a27653e482[WEB]
- https://github.com/http4s/http4s[PACKAGE]
- https://github.com/http4s/http4s/releases/tag/v0.23.35[WEB]
- https://github.com/http4s/http4s/releases/tag/v1.0.0-M47[WEB]