Skip to content
OpenAdvisories
Medium · 6.5 CVE-2022-23607 EUVD-2022-0341GHSA-fhpf-pp6p-55qcPYSEC-2022-26

Unsafe handling of user-specified cookies in treq

Published Feb 1, 2022 · Updated Aug 3, 2024 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
twisted treq < 22.1.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 python-treq 22.2.0-0.1 —
Debian 13 python-treq 22.2.0-0.1 —
Debian 12 python-treq 22.2.0-0.1 —
Debian 9 python-treq 15.1.0-1+deb9u1 DLA-2954-1
ReleasePackageFixed inAdvisory
Ubuntu 26.10 python-treq No fix yet —
Ubuntu 26.04 LTS python-treq No fix yet —
Ubuntu 25.10 python-treq No fix yet —
Ubuntu 24.04 LTS python-treq No fix yet —
Ubuntu 22.04 LTS python-treq No fix yet —
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS python-treq No fix yet —
Ubuntu 18.04 LTS python-treq No fix yet —
ReleasePackageFixed inAdvisory
SUSE Package Hub 15 SP3 python-treq 20.3.0-bp153.2.3.1 openSUSE-SU-2022:10098-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed python-treq 22.1.0-1.1 openSUSE-SU-2025:15106-1, openSUSE-SU-2024:11806-1
openSUSE Leap 15.3 python-treq 20.3.0-bp153.2.3.1 openSUSE-SU-2022:10098-1
ReleasePackageFixed inAdvisory
Alpine v3.24 py3-treq 22.1.0-r0 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI treq < 22.1.0 22.1.0 GHSA-fhpf-pp6p-55qc
PyPI treq >= 21.1.0, < 22.1.0 22.1.0 PYSEC-2022-26

Advisories 4

References