CVE-2023-22465: Http4s core 2.13 Http4s Improperly Parses User-Agent And Vulnerability

HIGH
Advisory Identifier: GHSA-54w6-vxfh-fw7f
CVSS 7.5
CWE-20
Published
Advisory Summary

CVE-2023-22465 is a HIGH (CVSS 7.5) http4s improperly parses user-agent and vulnerability (CWE-20: Improper Input Validation) affecting Http4s core 2.13 libraries in the Maven ecosystem. The issue involves http4s improperly parses user-agent and server headers. Remediation is available by upgrading affected packages to version 0.21.34, 0.22.15, 0.23.17, 1.0.0-M38.

CVE-2023-22465 at a Glance

CVE Identifier CVE-2023-22465
GHSA Identifier GHSA-54w6-vxfh-fw7f
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Http4s core 2.13
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2023-22465

To remediate this vulnerability, upgrade all affected Http4s core 2.13 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.http4s:http4s-core_2.13 fixed: 0.21.34
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.13</artifactId>
    <version>0.21.34</version>
</dependency>
org.http4s:http4s-core_2.13 fixed: 0.22.15
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.13</artifactId>
    <version>0.22.15</version>
</dependency>
org.http4s:http4s-core_2.13 fixed: 0.23.17
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.13</artifactId>
    <version>0.23.17</version>
</dependency>
org.http4s:http4s-core_2.13 fixed: 1.0.0-M38
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.13</artifactId>
    <version>1.0.0-M38</version>
</dependency>
org.http4s:http4s-core_2.10 fixed: Latest secure release
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.10</artifactId>
    <version>Latest secure release</version>
</dependency>
org.http4s:http4s-core_2.11 fixed: Latest secure release
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.11</artifactId>
    <version>Latest secure release</version>
</dependency>
org.http4s:http4s-core_2.12 fixed: 0.21.34
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.12</artifactId>
    <version>0.21.34</version>
</dependency>
org.http4s:http4s-core_2.12 fixed: 0.22.15
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.12</artifactId>
    <version>0.22.15</version>
</dependency>
org.http4s:http4s-core_2.12 fixed: 0.23.17
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core_2.12</artifactId>
    <version>0.23.17</version>
</dependency>
org.http4s:http4s-core fixed: Latest secure release
<dependency>
    <groupId>org.http4s</groupId>
    <artifactId>http4s-core</artifactId>
    <version>Latest secure release</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.http4s

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-22465, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.http4s

Analyze the terminal output to locate any version of Http4s core 2.13 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.21.34), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.http4s command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Http4s core 2.13, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 ```scala val unsafe: Option[`User-Agent`] = req.headers.get(`User-Agent`) ``` #### v0.22.x, v0.23.x, v1.x ```scala 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 ```scala 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 ```scala val safe: Option[Header] = req.headers.get(ci"User-Agent") ```

CVE-2023-22465 Affected Http4s core 2.13 Versions

10 component(s)
Fixed Versions:
0.21.340.22.150.23.171.0.0-M38
Product / Package Ecosystem Affected Versions Fixed Version
org.http4s:http4s-core_2.13
Maven
≥ 0.1.0
< 0.21.34
0.21.34
org.http4s:http4s-core_2.13
Maven
≥ 0.22.0
< 0.22.15
0.22.15
org.http4s:http4s-core_2.13
Maven
≥ 0.23.0
< 0.23.17
0.23.17
org.http4s:http4s-core_2.13
Maven
≥ 1.0.0-M1
< 1.0.0-M38
1.0.0-M38
org.http4s:http4s-core_2.10
Maven
≥ 0.1.0
≤ 0.9.3
org.http4s:http4s-core_2.11
Maven
≥ 0.1.0
≤ 0.21.0-M1
org.http4s:http4s-core_2.12
Maven
≥ 0.1.0
< 0.21.34
0.21.34
org.http4s:http4s-core_2.12
Maven
≥ 0.22.0
< 0.22.15
0.22.15
org.http4s:http4s-core_2.12
Maven
≥ 0.23.0
< 0.23.17
0.23.17
org.http4s:http4s-core
Maven
≥ 1.0.0-M1
≤ 1.0.0-M30

References

Frequently Asked Questions

What is CVE-2023-22465?
CVE-2023-22465 is a security vulnerability in Http4s core 2.13 involving Http4s improperly parses User-Agent and Server headers under CWE-20: Improper Input Validation.
Which Http4s core 2.13 versions are affected?
Affected versions include releases prior to 0.21.34, 0.22.15, 0.23.17, 1.0.0-M38 across affected packages: org.http4s:http4s-core_2.13, org.http4s:http4s-core_2.10, org.http4s:http4s-core_2.11, org.http4s:http4s-core_2.12, org.http4s:http4s-core.
What version fixes CVE-2023-22465?
Upgrading to 0.21.34, 0.22.15, 0.23.17, 1.0.0-M38 (or the latest patched release for your respective branch) resolves the vulnerability.
Is http4s-core_2.13 affected?
Yes, org.http4s:http4s-core_2.13 is affected in releases prior to 0.21.34, 0.22.15, 0.23.17, 1.0.0-M38. Upgrade your dependency to 0.21.34, 0.22.15, 0.23.17, 1.0.0-M38 or later.
Is http4s-core_2.10 affected?
Yes, org.http4s:http4s-core_2.10 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2023-22465?
CVE-2023-22465 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-22465?
CVE-2023-22465 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Maven dependencies for CVE-2023-22465?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.http4s'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-54w6-vxfh-fw7f",
  "modified" : "2025-12-11T20:58:47Z",
  "published" : "2023-01-06T20:24:36Z",
  "aliases" : [ "CVE-2023-22465" ],
  "summary" : "Http4s improperly parses User-Agent and Server headers",
  "details" : "### Impact\n\nThe `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. \n\n#### v0.21.x\n\n```scala\nval unsafe: Option[`User-Agent`] = req.headers.get(`User-Agent`)\n```\n\n#### v0.22.x, v0.23.x, v1.x\n\n```scala\nval unsafe: Option[`User-Agent`] = req.headers.get[`User-Agent`]\nval alsoUnsafe: Option[`Server`] = req.headers.get[Server]\n```\n\n### Patches\n\nFixes are released in 0.21.34, 0.22.15, 0.23.17, and 1.0.0-M38.\n\n### Workarounds\n\n#### Use the weakly typed header interface\n\n##### v0.21.x\n\n```scala\nval safe: Option[Header] = req.headers.get(\"User-Agent\".ci)\n// but don't do this\nval unsafe = header.map(_.parsed) \n```\n\n##### v0.22.x, v0.23.x, v1.x\n\n```scala\nval safe: Option[Header] = req.headers.get(ci\"User-Agent\")\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.13"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.21.34"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.13"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.22.0"
      }, {
        "fixed" : "0.22.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.13"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.23.0"
      }, {
        "fixed" : "0.23.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.13"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0-M1"
      }, {
        "fixed" : "1.0.0-M38"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.10"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "last_affected" : "0.9.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.11"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "last_affected" : "0.21.0-M1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.12"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.21.34"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.12"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.22.0"
      }, {
        "fixed" : "0.22.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core_2.12"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.23.0"
      }, {
        "fixed" : "0.23.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4s:http4s-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0-M1"
      }, {
        "last_affected" : "1.0.0-M30"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/http4s/http4s/security/advisories/GHSA-54w6-vxfh-fw7f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22465"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/http4s/http4s"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-06T20:24:36Z",
    "nvd_published_at" : "2023-01-04T16:15:00Z"
  }
}