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.

Severity (CVSS 3.1)6.5Medium
Exploit odds (30 days)1.1%top 34.7% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Alpine:v3.24py3-treq22.1.0-r0ALPINE-CVE-2022-23607
Debian:12python-treq22.2.0-0.1DEBIAN-CVE-2022-23607
Debian:13python-treq22.2.0-0.1DEBIAN-CVE-2022-23607
Debian:14python-treq22.2.0-0.1DEBIAN-CVE-2022-23607
PyPItreq22.1.0PYSEC-2022-26
PyPItreq22.1.0GHSA-fhpf-pp6p-55qc
Ubuntu:22.04:LTSpython-treqno fix listedUBUNTU-CVE-2022-23607
Ubuntu:24.04:LTSpython-treqno fix listedUBUNTU-CVE-2022-23607
Ubuntu:25.10python-treqno fix listedUBUNTU-CVE-2022-23607
Ubuntu:26.04:LTSpython-treqno fix listedUBUNTU-CVE-2022-23607
Ubuntu:26.10python-treqno fix listedUBUNTU-CVE-2022-23607

Affected products (as reported)

VendorProductVersions
twisted treq < 22.1.0

Weakness: CWE-200 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

References