Vulnerability · Published Feb 1, 2022 · Assigned by GitHub_M
CVE-2022-23607Unsafe handling of user-specified cookies in treq
Medium 6.5
In plain English
A medium-severity information exposure in treq from twisted. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.1% (higher than 65% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
treq is an HTTP library inspired by requests but written on top of Twisted's Agents. Treq's request methods (`treq.get`, `treq.post`, etc.) and `treq.client.HTTPClient` constructor accept cookies as a dictionary. Such cookies are not bound to a single domain, and are therefore sent to *every* domain ("supercookies"). This can potentially cause sensitive information to leak upon an HTTP redirect to a different domain., e.g. should `https://example.com` redirect to `http://cloudstorageprovider.com` the latter will receive the cookie `session`. Treq 2021.1.0 and later bind cookies given to request methods (`treq.request`, `treq.get`, `HTTPClient.request`, `HTTPClient.get`, etc.) to the origin of the *url* parameter. Users are advised to upgrade. For users unable to upgrade Instead of passing a dictionary as the *cookies* argument, pass a `http.cookiejar.CookieJar` instance with properly domain- and scheme-scoped cookies in it.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.24 | py3-treq | 22.1.0-r0 | ALPINE-CVE-2022-23607 |
| Debian:12 | python-treq | 22.2.0-0.1 | DEBIAN-CVE-2022-23607 |
| Debian:13 | python-treq | 22.2.0-0.1 | DEBIAN-CVE-2022-23607 |
| Debian:14 | python-treq | 22.2.0-0.1 | DEBIAN-CVE-2022-23607 |
| PyPI | treq | 22.1.0 | PYSEC-2022-26 |
| PyPI | treq | 22.1.0 | GHSA-fhpf-pp6p-55qc |
| Ubuntu:22.04:LTS | python-treq | no fix listed | UBUNTU-CVE-2022-23607 |
| Ubuntu:24.04:LTS | python-treq | no fix listed | UBUNTU-CVE-2022-23607 |
| Ubuntu:25.10 | python-treq | no fix listed | UBUNTU-CVE-2022-23607 |
| Ubuntu:26.04:LTS | python-treq | no fix listed | UBUNTU-CVE-2022-23607 |
| Ubuntu:26.10 | python-treq | no fix listed | UBUNTU-CVE-2022-23607 |
Affected products (as reported)
Weakness: CWE-200 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
References
- https://github.com/twisted/treq/security/advisories/GHSA-fhpf-pp6p-55qc x_refsource_CONFIRM
- [debian-lts-announce] 20220318 [SECURITY] [DLA 2954-1] python-treq security update mailing-list, x_refsource_MLIST