# CVE-2023-22465: Http4s has fatal error parsing User-Agent and Server headers

> Attackers can cause a fatal error and denial of service in Http4s services by sending malformed User-Agent or Server headers to applications that explicitly request these typed headers.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Jan 2023
- **Updated:** 10 Mar 2025
- **Also known as:** GHSA-54w6-vxfh-fw7f

## What is CVE-2023-22465?

CVE-2023-22465 is a high-severity denial of service vulnerability in http4s, published on 4 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2023-22465?

20 open source packages ship an affected version, including org.http4s:http4s-core_2.13, org.http4s:http4s-core and org.http4s:http4s-core_2.10. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.http4s:http4s-core_2.13` | Maven | From 0.1.0 | 0.21.34 |
| `org.http4s:http4s-core_2.13` | Maven | From 0.1.0 | 0.21.34 |
| `org.http4s:http4s-core_2.13` | Maven | From 0.22.0 | 0.22.15 |
| `org.http4s:http4s-core_2.13` | Maven | From 0.22.0 | 0.22.15 |
| `org.http4s:http4s-core_2.13` | Maven | From 0.23.0 | 0.23.17 |
| `org.http4s:http4s-core_2.13` | Maven | From 0.23.0 | 0.23.17 |
| `org.http4s:http4s-core_2.13` | Maven | From 1.0.0-M1 | 1.0.0-M38 |
| `org.http4s:http4s-core_2.13` | Maven | From 1.0.0-M1 | 1.0.0-M38 |
| `org.http4s:http4s-core` | Maven | From 1.0.0-M1 to 1.0.0-M30 | None |
| `org.http4s:http4s-core` | Maven | From 1.0.0-M1 to 1.0.0-M30 | None |
| `org.http4s:http4s-core_2.10` | Maven | From 0.1.0 to 0.9.3 | None |
| `org.http4s:http4s-core_2.10` | Maven | From 0.1.0 to 0.9.3 | None |
| `org.http4s:http4s-core_2.11` | Maven | From 0.1.0 to 0.21.0-M1 | None |
| `org.http4s:http4s-core_2.11` | Maven | From 0.1.0 to 0.21.0-M1 | None |
| `org.http4s:http4s-core_2.12` | Maven | From 0.1.0 | 0.21.34 |
| `org.http4s:http4s-core_2.12` | Maven | From 0.1.0 | 0.21.34 |
| `org.http4s:http4s-core_2.12` | Maven | From 0.22.0 | 0.22.15 |
| `org.http4s:http4s-core_2.12` | Maven | From 0.22.0 | 0.22.15 |
| `org.http4s:http4s-core_2.12` | Maven | From 0.23.0 | 0.23.17 |
| `org.http4s:http4s-core_2.12` | Maven | From 0.23.0 | 0.23.17 |

Products: Typelevel Http4s.

## How do I fix CVE-2023-22465?

Upgrade org.http4s:http4s-core_2.13 to a fixed version for your release line: 0.21.34, 0.22.15, 0.23.17 or 1.0.0-M38.

## Is CVE-2023-22465 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-22465 exists.

## Other vulnerabilities in http4s

- [CVE-2021-39185](https://insights.sbomify.com/CVE-2021-39185/): Default CORS config allows any origin with credentials (critical 9.1)
- [CVE-2021-41084](https://insights.sbomify.com/CVE-2021-41084/): Response Splitting from unsanitized headers in http4s (high 8.7)
- [CVE-2020-5280](https://insights.sbomify.com/CVE-2020-5280/): Local file inclusion vulnerability in http4s (high 7.6)
- [CVE-2021-21294](https://insights.sbomify.com/CVE-2021-21294/): Unbounded connection acceptance in http4s-blaze-server (high 7.5)
- [CVE-2025-59822](https://insights.sbomify.com/CVE-2025-59822/): Http4s vulnerable to HTTP Request Smuggling due to improper handling of HTTP trailer section (medium 6.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-22465 and fix it if it is affected.

What it is: CVE-2023-22465 is a high-severity denial of service vulnerability in http4s, published on 4 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-22465 exists.

Affected packages and fixed versions:
- org.http4s:http4s-core_2.13 (Maven): affected from 0.1.0; fixed in 0.21.34
- org.http4s:http4s-core_2.13 (Maven): affected from 0.1.0; fixed in 0.21.34
- org.http4s:http4s-core_2.13 (Maven): affected from 0.22.0; fixed in 0.22.15
- org.http4s:http4s-core_2.13 (Maven): affected from 0.22.0; fixed in 0.22.15
- org.http4s:http4s-core_2.13 (Maven): affected from 0.23.0; fixed in 0.23.17
- org.http4s:http4s-core_2.13 (Maven): affected from 0.23.0; fixed in 0.23.17
- org.http4s:http4s-core_2.13 (Maven): affected from 1.0.0-M1; fixed in 1.0.0-M38
- org.http4s:http4s-core_2.13 (Maven): affected from 1.0.0-M1; fixed in 1.0.0-M38
- org.http4s:http4s-core (Maven): affected from 1.0.0-M1 up to 1.0.0-M30; no fix listed
- org.http4s:http4s-core (Maven): affected from 1.0.0-M1 up to 1.0.0-M30; no fix listed
- org.http4s:http4s-core_2.10 (Maven): affected from 0.1.0 up to 0.9.3; no fix listed
- org.http4s:http4s-core_2.10 (Maven): affected from 0.1.0 up to 0.9.3; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-22465/ (Markdown: https://insights.sbomify.com/CVE-2023-22465/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-22465
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-22465
- OSV: https://osv.dev/vulnerability/CVE-2023-22465

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-22465/
Summaries are generated and may contain mistakes; the official description above is the record.
