CVE-2022-24737: Exposure of Sensitive Information to an Unauthorized Actor in httpie
(updated )
HTTPie have the practical concept of sessions, which help users to persistently store some of the state that belongs to the outgoing requests and incoming responses on the disk for further usage. As an example, we can make an authenticated request and save it to a named session called api
:
$ http --session api -a user:pass pie.dev/basic-auth/user/pass
{
"authenticated": true,
"user": "user"
}
Since we have now saved the authentication data to that session, we won‘t have to enter it again and again on every invocation. We can simply reference the session, and HTTPie will use the saved state directly from it:
$ http --session api pie.dev/basic-auth/user/pass
{
"authenticated": true,
"user": "user"
}
One particular use case of these sessions is storing cookies (commonly referred to as a Cookie Jar
). If a response has a Set-Cookie
header, HTTPie will parse it and store the actual cookie in the session. And from that point on, all outgoing requests will attach that cookie (in the form of a Cookie
header).
This is extremely useful, especially when you are dealing with websites which manage their own state on the client-side through cookies.
$ http -F --session jar pie.dev/cookies/set/x/y
{
"cookies": {
"x": "y"
}
}
Before 3.1.0
, HTTPie didn‘t distinguish between cookies and hosts they belonged. This behavior resulted in the exposure of some cookies when there are redirects originating from the actual host to a third party website, e.g:
$ http -F --session jar pie.dev/redirect-to url==https://httpbin.org/cookies
(Pre 3.1.0)
{
"cookies": {
"x": "y"
}
}
(Post 3.1.0)
{
"cookies": {}
}
This behavior has been corrected in this release (with taking RFC 6265 — HTTP State Management Mechanism into the consideration).
A huge credit goes to @Glyph for disclosing the original vulnerability to us (through huntr.dev).
References
- github.com/advisories/GHSA-9w4w-cpc8-h2fq
- github.com/httpie/httpie
- github.com/httpie/httpie/commit/65ab7d5caaaf2f95e61f9dd65441801c2ddee38b
- github.com/httpie/httpie/releases/tag/3.1.0
- github.com/httpie/httpie/security/advisories/GHSA-9w4w-cpc8-h2fq
- github.com/pypa/advisory-database/tree/main/vulns/httpie/PYSEC-2022-34.yaml
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4QZD2AZOL7XLNZVAV6GDNXYU6MFRU5RS
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/R5VYSYKEKVZEVEBIWAADGDXG4Y3EWCQ3
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TXFCHGTW3V32GD6GXXJZE5QAOSDT3RTY
- nvd.nist.gov/vuln/detail/CVE-2022-24737
Detect and mitigate CVE-2022-24737 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →