Http4s: CookieJar middleware matches by substring, leaking cookies cross-origin
http4s
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| org.http4s:http4s-client_2.12 Maven |
|
|
| org.http4s:http4s-client_2.13 Maven |
|
|
http4s
| Product | Affected | Fixed in |
|---|---|---|
| org.http4s:http4s-client_2.12 Maven |
|
|
| org.http4s:http4s-client_2.13 Maven |
|
|
| org.http4s:http4s-client_3 Maven |
|
|
Http4s is a Scala interface for HTTP services. Prior to 0.23.35 and 1.0.0-M47, The CookieJar client middleware uses unanchored substring checks instead of RFC 6265 domain and path matching when deciding whether to attach a stored cookie. A cookie for example.com can consequently be sent to an attacker-controlled hostname such as evilexample.com when an application using the same jar makes an attacker-influenced outbound request. This exposes session or authentication cookies and can enable hijacking of the application’s outbound sessions. This issue is fixed in versions 0.23.35 and 1.0.0-M47.
From the CVE record · GitHub_M
The http4s CookieJar client middleware uses substring checks instead of domain and path matching when attaching stored cookies. If an application using the same jar makes an attacker-influenced outbound request, it can send session or authentication cookies to an attacker-controlled hostname, potentially enabling outbound session hijacking.
Engineers using Maven org.http4s:http4s-client_2.12, http4s-client_2.13, or http4s-client_3 below 0.23.35, or the _2.13 and _3 packages from 1.0.0-M1 through versions before 1.0.0-M47, should check their deployments.