logo

CVE-2022-24737 httpie

Package

Manager: pip
Name: httpie
Vulnerable Version: >=0 <3.1.0

Severity

Level: Medium

CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

EPSS: 0.006 pctl0.68515

Details

Exposure of Sensitive Information to an Unauthorized Actor in httpie ### Impact HTTPie have the practical concept of [sessions](https://httpie.io/docs/cli/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](https://httpie.io/docs/cli/named-sessions) called `api`: ```bash $ http --session api -a user:pass pie.dev/basic-auth/user/pass ``` ```json { "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: ```bash $ http --session api pie.dev/basic-auth/user/pass ``` ```json { "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. ```bash $ http -F --session jar pie.dev/cookies/set/x/y ``` ```json { "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: ```bash $ http -F --session jar pie.dev/redirect-to url==https://httpbin.org/cookies ``` (Pre 3.1.0) ```json { "cookies": { "x": "y" } } ``` (Post 3.1.0) ```json { "cookies": {} } ``` This behavior has been corrected in this release (with taking [RFC 6265 — HTTP State Management Mechanism](https://datatracker.ietf.org/doc/html/rfc6265) into the consideration). A huge credit goes to [@Glyph](https://github.com/glyph) for disclosing the original vulnerability to us (through [huntr.dev](http://huntr.dev/)). ### Patches We suggest users to upgrade their HTTPie version to `3.1.0` or higher, and run `httpie cli sessions upgrade` command on their sessions. ### For more information If you have any questions or comments about this advisory: * Email us: [`security@httpie.io`](mailto:security@httpie.io) > Please note that this entry is covered by both [CVE-2022-24737](https://www.cvedetails.com/cve/CVE-2022-24737) and [CVE-2022-0430](https://nvd.nist.gov/vuln/detail/CVE-2022-0430).

Metadata

Created: 2022-03-07T23:44:28Z
Modified: 2024-09-23T17:02:49Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/03/GHSA-9w4w-cpc8-h2fq/GHSA-9w4w-cpc8-h2fq.json
CWE IDs: ["CWE-200"]
Alternative ID: GHSA-9w4w-cpc8-h2fq
Finding: F017
Auto approve: 1