{ "schema_version": "1.4.0", "id": "GHSA-54w6-vxfh-fw7f", "modified": "2023-01-06T20:24:36Z", "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" }, "ranges": [ { "type": "ECOSYSTEM", "events": [ { "introduced": "0.1.0" }, { "fixed": "0.21.34" } ] } ] }, { "package": { "ecosystem": "Maven", "name": "org.http4s:http4s-core" }, "ranges": [ { "type": "ECOSYSTEM", "events": [ { "introduced": "0.22.0" }, { "fixed": "0.22.15" } ] } ] }, { "package": { "ecosystem": "Maven", "name": "org.http4s:http4s-core" }, "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" }, { "fixed": "1.0.0-M38" } ] } ] } ], "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" } }