# CVE-2022-23607: Unsafe handling of user-specified cookies in treq

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.16%, higher than 68% of CVEs (2026-12-01)
- Published: 2022-02-01T00:43:38.000Z
- Modified: 2026-06-17T04:30:28.133Z
- Also known as: GHSA-fhpf-pp6p-55qc, PYSEC-2022-26
- Weaknesses: CWE-200, CWE-425, CWE-601
- 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.

(As written by CVE List.)

## Affected

- twisted treq: < 22.1.0
- treq (PyPI): before 22.1.0; from 21.1.0 before 22.1.0
- twistedmatrix treq: from 21.1.0 before 22.1.0
- debian debian_linux: 9.0

## Every score

- GitHub_M: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`
- GitHub: CVSS:3.1 6.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:P/I:N/A:N`

## References

- <https://github.com/twisted/treq/security/advisories/GHSA-fhpf-pp6p-55qc> (advisory, mitigation, third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2022/03/msg00025.html> (mailing-list, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-23607> (advisory)
- <https://github.com/twisted/treq/commit/1da6022cc880bbcff59321abe02bf8498b89efb2> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/treq/PYSEC-2022-26.yaml> (web)
- <https://github.com/twisted/treq> (package)
- <https://github.com/twisted/treq/releases/tag/release-22.1.0> (web)
- <https://huntr.dev/bounties/3c9204fc-a3d1-4441-8599-924c5f57e7ae/?token=06d930e37046c914bcb037e85cc227dc7b510b475989fc69837566562ba899277d46b0fb4b1e21cdcb6ddc1b7d9b1ded632cf3a3551ecb89afca16a63b34641284b50479d5195bba2ac09b116f3dd4fad27f54404c2de922c05c8c8b744aec27bb4d4d198cb8b3abf479af0c2d5fbaa10412da7922594ac3eb39> (web)

## Sources

- CVE List: [CVE-2022-23607](https://www.cve.org/CVERecord?id=CVE-2022-23607), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-fhpf-pp6p-55qc](https://github.com/advisories/GHSA-fhpf-pp6p-55qc), CC-BY-4.0, modified 2024-11-13
- NVD: [CVE-2022-23607](https://nvd.nist.gov/vuln/detail/CVE-2022-23607), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2022-26](https://osv.dev/vulnerability/PYSEC-2022-26), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2022-23607 · Whole record: https://cve.day/CVE-2022-23607.json · Rebuilt by cve.day 2026-11-25T22:58:09.454Z
