Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS05dzR3LWNwYzgtaDJmcc0wjg

Exposure of Sensitive Information to an Unauthorized Actor in httpie

Impact

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).

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:

Please note that this entry is covered by both CVE-2022-24737 and CVE-2022-0430.

Permalink: https://github.com/advisories/GHSA-9w4w-cpc8-h2fq
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS05dzR3LWNwYzgtaDJmcc0wjg
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 2 years ago
Updated: over 1 year ago


CVSS Score: 6.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Identifiers: GHSA-9w4w-cpc8-h2fq, CVE-2022-24737
References: Repository: https://github.com/httpie/httpie
Blast Radius: 23.3

Affected Packages

pypi:httpie
Dependent packages: 26
Dependent repositories: 3,903
Downloads: 373,615 last month
Affected Version Ranges: < 3.1.0
Fixed in: 3.1.0
All affected versions: 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.6.0, 0.7.0, 0.7.2, 0.8.0, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 1.0.0, 1.0.2, 1.0.3, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.0, 3.0.0, 3.0.1, 3.0.2
All unaffected versions: 3.1.0, 3.2.0, 3.2.1, 3.2.2