{"id":"CVE-2022-23607","published":"2022-02-01T11:01:07Z","modified":"2024-08-03T03:43:46Z","title":"Unsafe handling of user-specified cookies in treq","vendor":"twisted","product":"treq","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01083,"percentile":0.66036,"provenance":"source"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"references":[{"url":"https://github.com/twisted/treq/security/advisories/GHSA-fhpf-pp6p-55qc","tags":["x_refsource_CONFIRM"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/03/msg00025.html","tags":["mailing-list","x_refsource_MLIST"]}],"priority":{"score":17.8,"factors":[{"name":"EPSS percentile","points":13.21},{"name":"CVSS severity","points":4.55}]},"vendorSlug":"twisted","affectedVersions":[{"vendor":"twisted","product":"treq","versions":["< 22.1.0"]}],"affected":[{"ecosystem":"PyPI","package":"treq","vulnerableRanges":["<22.1.0",">=21.1.0, <22.1.0"],"patched":["22.1.0"],"from":["GHSA-fhpf-pp6p-55qc","PYSEC-2022-26"],"provenance":"source"}],"summary":{"text":"The treq HTTP library for Twisted mishandles cookies passed to its request methods and HTTPClient constructor as a plain dictionary, because those cookies are not scoped to any domain and are sent to every host the request reaches. An attacker who can induce a redirect from the intended site to a domain they control, with user interaction required, can cause session cookies to be disclosed to that other domain.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:42:56Z"},"euvd":{"id":"EUVD-2022-0341","exploited":false,"provenance":"source"}}