CVE-2023-22465
JSON

7.5high

Http4s has fatal error parsing User-Agent and Server headers

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.95% (higher than 60% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-54w6-vxfh-fw7f

Description

Http4s is a Scala interface for HTTP services. Starting with version 0.1.0 and prior to versions 0.21.34, 0.22.15, 0.23.17, and 1.0.0-M38, the `User-Agent` and `Server` header parsers are susceptible to a fatal error on certain inputs. In http4s, modeled headers are lazily parsed, so this only applies to services that explicitly request these typed headers. Fixes are released in 0.21.34, 0.22.15, 0.23.17, and 1.0.0-M38. As a workaround, use the weakly typed header interface.

Affected

Product or packageVersionsReported by
http4s http4s>= 0.1.0, < 0.21.34, >= 0.22.0, < 0.22.15, >= 0.23.0, < 0.23.17, >= 1.0.0-M1, < 1.0.0-M38CVE List
org.http4s:http4s-core_2.13 (Maven)from 0.1.0 before 0.21.34, from 0.22.0 before 0.22.15, from 0.23.0 before 0.23.17, from 1.0.0-M1 before 1.0.0-M38GitHub Advisory Database
org.http4s:http4s-core_2.10 (Maven)from 0.1.0 up to 0.9.3GitHub Advisory Database
org.http4s:http4s-core_2.11 (Maven)from 0.1.0 up to 0.21.0-M1GitHub Advisory Database
org.http4s:http4s-core_2.12 (Maven)from 0.1.0 before 0.21.34, from 0.22.0 before 0.22.15, from 0.23.0 before 0.23.17GitHub Advisory Database
org.http4s:http4s-core (Maven)from 1.0.0-M1 up to 1.0.0-M30GitHub Advisory Database
typelevel http4sfrom 0.1.0 before 0.21.34, from 0.22.0 before 0.22.15, from 0.23.0 before 0.23.17, 1.0.0NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Classification

CWE-20

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

Http4s is a Scala interface for HTTP services. Starting with version 0.1.0 and prior to versions 0.21.34, 0.22.15, 0.23.17, and 1.0.0-M38, the `User-Agent` and `Server` header parsers are susceptible to a fatal error on certain inputs. In http4s, modeled headers are lazily parsed, so this only applies to services that explicitly request these typed headers. Fixes are released in 0.21.34, 0.22.15, 0.23.17, and 1.0.0-M38. As a workaround, use the weakly typed header interface.

GitHub Advisory Database
Impact

The User-Agent and Server header parsers are susceptible to a fatal error on certain inputs. In http4s, modeled headers are lazily parsed, so this only applies to services that explicitly request these typed headers.

v0.21.x
val unsafe: Option[`User-Agent`] = req.headers.get(`User-Agent`)
v0.22.x, v0.23.x, v1.x
val unsafe: Option[`User-Agent`] = req.headers.get[`User-Agent`]
val alsoUnsafe: Option[`Server`] = req.headers.get[Server]
Patches

Fixes are released in 0.21.34, 0.22.15, 0.23.17, and 1.0.0-M38.

Workarounds
Use the weakly typed header interface
v0.21.x
val safe: Option[Header] = req.headers.get("User-Agent".ci)
// but don't do this
val unsafe = header.map(_.parsed) 
v0.22.x, v0.23.x, v1.x
val safe: Option[Header] = req.headers.get(ci"User-Agent")
NVD (es)

Http4s es una interfaz de Scala para servicios HTTP. A partir de la versión 0.1.0 y anteriores a las versiones 0.21.34, 0.22.15, 0.23.17 y 1.0.0-M38, los analizadores de encabezado `User-Agent` y `Server` son susceptibles a un error fatal en ciertas entradas. En http4s, los encabezados modelados se analizan de forma diferida, por lo que esto solo se aplica a los servicios que solicitan explícitamente estos encabezados escritos. Las correcciones se publicaron en 0.21.34, 0.22.15, 0.23.17 y 1.0.0-M38. Como workaround, utilice la interfaz de encabezado con tipos débiles.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-22465 changed 2025-03-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-54w6-vxfh-fw7f changed 2025-12-11CC-BY-4.0
NVDCVE-2023-22465 changed 2026-06-17Public domain