CVE-2021-41084: Http4s client 2.12 Response Splitting From Unsanitized Headers Vulnerability
HIGHCVE-2021-41084 is a HIGH (CVSS 8.7) response splitting from unsanitized headers vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Http4s client 2.12 libraries in the Maven ecosystem. The issue involves response splitting from unsanitized headers. Remediation is available by upgrading affected packages to version 0.21.29, 0.22.5, 0.23.4.
CVE-2021-41084 at a Glance
Security Impact
CVSS: 8.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N).
How to Fix CVE-2021-41084
To remediate this vulnerability, upgrade all affected Http4s client 2.12 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_2.12</artifactId>
<version>0.21.29</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_2.12</artifactId>
<version>0.22.5</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_2.12</artifactId>
<version>0.23.4</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_2.13</artifactId>
<version>0.21.29</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_2.13</artifactId>
<version>0.22.5</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_2.13</artifactId>
<version>0.23.4</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_3</artifactId>
<version>0.21.29</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_3</artifactId>
<version>0.22.5</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-client_3</artifactId>
<version>0.23.4</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.10</artifactId>
<version>Latest secure release</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.11</artifactId>
<version>Latest secure release</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.12</artifactId>
<version>0.21.29</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.12</artifactId>
<version>0.22.5</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.12</artifactId>
<version>0.23.4</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.13</artifactId>
<version>0.21.29</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.13</artifactId>
<version>0.22.5</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.13</artifactId>
<version>0.23.4</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_2.13.0-M5</artifactId>
<version>Latest secure release</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_3</artifactId>
<version>0.22.5</version>
</dependency>
<dependency>
<groupId>org.http4s</groupId>
<artifactId>http4s-server_3</artifactId>
<version>0.23.4</version>
</dependency>
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-2021-41084, 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 client 2.12 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.21.29), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Http4s client 2.12, 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
CVE-2021-41084 Affected Http4s client 2.12 Versions
20 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.http4s:http4s-client_2.12
|
Maven |
< 0.21.29
|
0.21.29
|
|
org.http4s:http4s-client_2.12
|
Maven |
≥ 0.22.0
< 0.22.5
|
0.22.5
|
|
org.http4s:http4s-client_2.12
|
Maven |
≥ 0.23.0
< 0.23.4
|
0.23.4
|
|
org.http4s:http4s-client_2.13
|
Maven |
< 0.21.29
|
0.21.29
|
|
org.http4s:http4s-client_2.13
|
Maven |
≥ 0.22.0
< 0.22.5
|
0.22.5
|
|
org.http4s:http4s-client_2.13
|
Maven |
≥ 0.23.0
< 0.23.4
|
0.23.4
|
|
org.http4s:http4s-client_3
|
Maven |
< 0.21.29
|
0.21.29
|
|
org.http4s:http4s-client_3
|
Maven |
≥ 0.22.0
< 0.22.5
|
0.22.5
|
|
org.http4s:http4s-client_3
|
Maven |
≥ 0.23.0
< 0.23.4
|
0.23.4
|
|
org.http4s:http4s-server_2.10
|
Maven |
≤ 0.21.28
|
|
|
org.http4s:http4s-server_2.11
|
Maven |
≤ 0.21.28
|
|
|
org.http4s:http4s-server_2.12
|
Maven |
< 0.21.29
|
0.21.29
|
|
org.http4s:http4s-server_2.12
|
Maven |
≥ 0.22.0
< 0.22.5
|
0.22.5
|
|
org.http4s:http4s-server_2.12
|
Maven |
≥ 0.23.0
< 0.23.4
|
0.23.4
|
|
org.http4s:http4s-server_2.13
|
Maven |
< 0.21.29
|
0.21.29
|
|
org.http4s:http4s-server_2.13
|
Maven |
≥ 0.22.0
< 0.22.5
|
0.22.5
|
|
org.http4s:http4s-server_2.13
|
Maven |
≥ 0.23.0
< 0.23.4
|
0.23.4
|
|
org.http4s:http4s-server_2.13.0-M5
|
Maven |
≤ 0.21.28
|
|
|
org.http4s:http4s-server_3
|
Maven |
≥ 0.22.0
< 0.22.5
|
0.22.5
|
|
org.http4s:http4s-server_3
|
Maven |
≥ 0.23.0
< 0.23.4
|
0.23.4
|
References
Frequently Asked Questions
What is CVE-2021-41084?
Which Http4s client 2.12 versions are affected?
What version fixes CVE-2021-41084?
Is http4s-client_2.12 affected?
Is http4s-client_2.13 affected?
What is the CVSS score of CVE-2021-41084?
What CWE is associated with CVE-2021-41084?
How can I check Maven dependencies for CVE-2021-41084?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5vcm-3xc3-w7x3",
"modified" : "2025-12-11T21:12:05Z",
"published" : "2021-09-22T19:18:41Z",
"aliases" : [ "CVE-2021-41084" ],
"summary" : "Response Splitting from unsanitized headers",
"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)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_2.12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.21.29"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.21.28"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_2.12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.22.0"
}, {
"fixed" : "0.22.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.22.4"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_2.12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.23.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.23.3"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_2.13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.21.29"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.21.28"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_2.13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.22.0"
}, {
"fixed" : "0.22.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.22.4"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_2.13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.23.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.23.3"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.21.29"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.21.28"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.22.0"
}, {
"fixed" : "0.22.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.22.4"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-client_3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.23.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.23.3"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.10"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.21.28"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.11"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.21.28"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.21.29"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.21.28"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.22.0"
}, {
"fixed" : "0.22.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.22.4"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.23.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.23.3"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.21.29"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.21.28"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.22.0"
}, {
"fixed" : "0.22.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.22.4"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.23.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.23.3"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_2.13.0-M5"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.21.28"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.22.0"
}, {
"fixed" : "0.22.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.22.4"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.http4s:http4s-server_3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.23.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.23.3"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/http4s/http4s/security/advisories/GHSA-5vcm-3xc3-w7x3"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41084"
}, {
"type" : "WEB",
"url" : "https://github.com/http4s/http4s/commit/d02007db1da4f8f3df2dbf11f1db9ac7afc3f9d8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/http4s/http4s"
}, {
"type" : "WEB",
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74", "CWE-918" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-09-21T16:10:13Z",
"nvd_published_at" : "2021-09-21T18:15:00Z"
}
}