原始 OSV JSON{
"id": "GHSA-5vcm-3xc3-w7x3",
"aliases": [
"CVE-2021-41084"
],
"details": "### Impact\n\nhttp4s is vulnerable to response-splitting or request-splitting attacks when untrusted user input is used to create any of the following fields:\n\n* Header names (`Header.name`å\n* Header values (`Header.value`)\n* Status reason phrases (`Status.reason`)\n* URI paths (`Uri.Path`)\n* URI authority registered names (`URI.RegName`) (through 0.21)\n\nThe following backends render invalid carriage return, newline, or null characters in an unsafe fashion.\n\n| | blaze-server | ember-server | blaze-client | ember-client | jetty-client |\n|:---------------|:-------------|:-------------|:-------------|--------------|--------------|\n| header names | ⚠ | ⚠ | ⚠ | ⚠ | ⚠ | \n| header values | ⚠ | ⚠ | ⚠ | ⚠ | |\n| status reasons | ⚠ | ⚠ | | | |\n| URI paths | | | ⚠ | ⚠ | |\n| URI regnames | | | ⚠ < 0.22 | ⚠ < 0.22 | |\n\nFor example, given the following service:\n\n```scala\nimport cats.effect._\nimport org.http4s._\nimport org.http4s.dsl.io._\nimport org.http4s.server.blaze.BlazeServerBuilder\nimport scala.concurrent.ExecutionContext.global\n\nobject ResponseSplit extends IOApp {\n override def run(args: List[String]): IO[ExitCode] =\n BlazeServerBuilder[IO](global)\n .bindHttp(8080)\n .withHttpApp(httpApp)\n .resource\n .use(_ => IO.never)\n\n val httpApp: HttpApp[IO] =\n HttpApp[IO] { req =>\n req.params.get(\"author\") match {\n case Some(author) =>\n Ok(\"The real content\")\n .map(_.putHeaders(Header(\"Set-Cookie\", s\"author=${author}\")))\n case None =>\n BadRequest(\"No author parameter\")\n }\n }\n}\n```\n\nA clean `author` parameter returns a clean response:\n\n```sh\ncurl -i 'http://localhost:8080/?author=Ross'\n```\n\n```http\nHTTP/1.1 200 OK\nContent-Type: text/plain; charset=UTF-8\nSet-Cookie: author=Ross\nDate: Mon, 20 Sep 2021 04:12:10 GMT\nContent-Length: 16\n\nThe real content\n```\n\nA malicious `author` parameter allows a user-agent to hijack the response from our server and return different content:\n\n```sh\ncurl -i 'http://localhost:8080/?author=hax0r%0d%0aContent-Length:+13%0d%0a%0aI+hacked+you'\n```\n\n```http\nHTTP/1.1 200 OK\nContent-Type: text/plain; charset=UTF-8\nSet-Cookie: author=hax0r\nContent-Length: 13\n\nI hacked you\n```\n\n### Patches\n\nVersions 0.21.29, 0.22.5, 0.23.4, and 1.0.0-M27 perform the following:\n\n* If a status reasoon phrase is invalid, it is dropped. Rendering is optional per spec.\n* If a header name is invalid in a request or response, the header is dropped. There is no way to generically sanitize a header without potentially shadowing a correct one.\n* If a header value is invalid in a request or response, it is sanitized by replacing null (`\\u0000`), carriage return (`\\r`), and newline (`\\n`) with space (` `) characters per spec.\n* If a URI path or registered name is invalid in a request line, the client raises an `IllegalArgumentException`.\n* If a URI registered name is invalid in a host header, the client raises an `IllegalArgumentException`. \n\n### Workarounds\n\nhttp4s services and client applications should sanitize any user input in the aforementioned fields before returning a request or response to the backend. The carriage return, newline, and null characters are the most threatening.\n\nNot all backends were affected: jetty-server, tomcat-server, armeria, and netty on the server; async-http-client, okhttp-client, armeria, and netty as clients.\n\n### References\n* https://owasp.org/www-community/attacks/HTTP_Response_Splitting\n* https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#fields.values\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [GitHub](http://github.com/http4s/http4s)\n* Contact us via the [http4s security policy](https://github.com/http4s/http4s/security/policy)",
"summary": "Response Splitting from unsanitized headers",
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.21.29"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_2.12",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.21.28"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.22.0"
},
{
"fixed": "0.22.5"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_2.12",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.22.4"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.23.0"
},
{
"fixed": "0.23.4"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_2.12",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.23.3"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.21.29"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_2.13",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.21.28"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.22.0"
},
{
"fixed": "0.22.5"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_2.13",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.22.4"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.23.0"
},
{
"fixed": "0.23.4"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_2.13",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.23.3"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.21.29"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_3",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.21.28"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.22.0"
},
{
"fixed": "0.22.5"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_3",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.22.4"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.23.0"
},
{
"fixed": "0.23.4"
}
]
}
],
"package": {
"name": "org.http4s:http4s-client_3",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.23.3"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.21.28"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.10",
"ecosystem": "Maven"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.21.28"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.11",
"ecosystem": "Maven"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.21.29"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.12",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.21.28"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.22.0"
},
{
"fixed": "0.22.5"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.12",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.22.4"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.23.0"
},
{
"fixed": "0.23.4"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.12",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.23.3"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.21.29"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.13",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.21.28"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.22.0"
},
{
"fixed": "0.22.5"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.13",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.22.4"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.23.0"
},
{
"fixed": "0.23.4"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.13",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.23.3"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.21.28"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_2.13.0-M5",
"ecosystem": "Maven"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.22.0"
},
{
"fixed": "0.22.5"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_3",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.22.4"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0.23.0"
},
{
"fixed": "0.23.4"
}
]
}
],
"package": {
"name": "org.http4s:http4s-server_3",
"ecosystem": "Maven"
},
"database_specific": {
"last_known_affected_version_range": "<= 0.23.3"
}
}
],
"modified": "2025-12-11T21:12:05Z",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N"
}
],
"published": "2021-09-22T19:18:41Z",
"references": [
{
"url": "https://github.com/http4s/http4s/security/advisories/GHSA-5vcm-3xc3-w7x3",
"type": "WEB"
},
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-41084",
"type": "ADVISORY"
},
{
"url": "https://github.com/http4s/http4s/commit/d02007db1da4f8f3df2dbf11f1db9ac7afc3f9d8",
"type": "WEB"
},
{
"url": "https://github.com/http4s/http4s",
"type": "PACKAGE"
},
{
"url": "https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#fields.values",
"type": "WEB"
},
{
"url": "https://owasp.org/www-community/attacks/HTTP_Response_Splitting",
"type": "WEB"
}
],
"schema_version": "1.4.0",
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-918"
],
"severity": "HIGH",
"github_reviewed": true,
"nvd_published_at": "2021-09-21T18:15:00Z",
"github_reviewed_at": "2021-09-21T16:10:13Z"
}
}