{"id":"CVE-2018-20852","details":"http.cookiejar.DefaultPolicy.domain_return_ok in Lib/http/cookiejar.py in Python before 3.7.3 does not correctly validate the domain: it can be tricked into sending existing cookies to the wrong server. An attacker may abuse this flaw by using a server with a hostname that has another valid hostname as a suffix (e.g., pythonicexample.com to steal cookies for example.com). When a program uses http.cookiejar.DefaultPolicy and tries to do an HTTP connection to an attacker-controlled server, existing cookies can be leaked to the attacker. This affects 2.x through 2.7.16, 3.x before 3.4.10, 3.5.x before 3.5.7, 3.6.x before 3.6.9, and 3.7.x before 3.7.3.","modified":"2026-04-10T04:07:42.997791Z","published":"2019-07-13T21:15:10.377Z","related":["ALSA-2020:1605","SUSE-SU-2019:14142-1","SUSE-SU-2019:14246-1","SUSE-SU-2019:2050-1","SUSE-SU-2019:2091-1","SUSE-SU-2019:2114-1","SUSE-SU-2019:2798-1","SUSE-SU-2020:0114-1","SUSE-SU-2020:0234-1","SUSE-SU-2020:0302-1","SUSE-SU-2020:2699-1","openSUSE-SU-2019:1988-1","openSUSE-SU-2019:1989-1","openSUSE-SU-2020:0086-1","openSUSE-SU-2024:11202-1","openSUSE-SU-2024:11284-1"],"references":[{"type":"WEB","url":"http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00074.html"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2020/07/msg00011.html"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2020/08/msg00034.html"},{"type":"WEB","url":"https://www.oracle.com/security-alerts/cpuapr2020.html"},{"type":"WEB","url":"https://usn.ubuntu.com/4127-2/"},{"type":"WEB","url":"http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2019/08/msg00022.html"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2019/08/msg00040.html"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZBTGPBUABGXZ7WH7677OEM3NSP6ZEA76/"},{"type":"WEB","url":"https://usn.ubuntu.com/4127-1/"},{"type":"WEB","url":"http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00071.html"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/COATURTCY7G67AYI6UDV5B2JZTBCKIDX/"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/K7HNVIFMETMFWWWUNTB72KYJYXCZOS5V/"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2019:3725"},{"type":"ADVISORY","url":"https://security.gentoo.org/glsa/202003-26"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2019:3948"},{"type":"ADVISORY","url":"https://python-security.readthedocs.io/vuln/cookie-domain-check.html"},{"type":"REPORT","url":"https://bugs.python.org/issue35121"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/python/cpython","events":[{"introduced":"ff139a8a44d079a8261292044c82f128343fea09"},{"last_affected":"413a49145e35c7a2d3a7de27c5a1828449c9b2e5"},{"introduced":"0"},{"fixed":"e76cbc781044ee01b059f3702c580e66266b84c5"},{"introduced":"2e789a1f1d84b343a996e8654590703b5fbdd441"},{"fixed":"1917d9b7c266d8be9ef1b403e38411ba871a0a37"},{"introduced":"5c4568a05a0a62b5947c55f68f9f2ecfb90a4f12"},{"fixed":"201c8f79450628241574fba940e08107178dc3a5"},{"introduced":"1bf9cc509326bc42cd8cb1650eb9bf64550d817e"},{"fixed":"ef4ec6ed12d6c6200a85068f60483723298b6ff4"}],"database_specific":{"versions":[{"introduced":"2.0"},{"last_affected":"2.7.16"},{"introduced":"3.0.0"},{"fixed":"3.4.10"},{"introduced":"3.5.0"},{"fixed":"3.5.7"},{"introduced":"3.6.0"},{"fixed":"3.6.9"},{"introduced":"3.7.0"},{"fixed":"3.7.3"}]}}],"versions":["v2.0","v2.1","v2.1a1","v2.1a2","v2.1b1","v2.1b2","v2.1c1","v2.1c2","v2.2a3","v2.3c1","v2.3c2","v2.4","v2.4a1","v2.4a2","v2.4a3","v2.4b1","v2.4b2","v2.4c1","v2.5a0","v2.5a1","v2.5a2","v2.5b1","v2.5b2","v2.5b3","v2.6","v2.6a1","v2.6a2","v2.6a3","v2.6b1","v2.6b2","v2.6b3","v2.6rc1","v2.6rc2","v2.7","v2.7.1","v2.7.10rc1","v2.7.11rc1","v2.7.12rc1","v2.7.13rc1","v2.7.15rc1","v2.7.16","v2.7.16rc1","v2.7.1rc1","v2.7.2rc1","v2.7.3rc1","v2.7.4rc1","v2.7.5","v2.7.6rc1","v2.7.8","v2.7.9rc1","v2.7a1","v2.7a2","v2.7a3","v2.7a4","v2.7b1","v2.7b2","v2.7rc1","v2.7rc2","v3.0a1","v3.0a2","v3.0a3","v3.0a4","v3.0a5","v3.0b1","v3.0b2","v3.0b3","v3.0rc1","v3.0rc2","v3.0rc3","v3.1","v3.1a1","v3.1a2","v3.1b1","v3.1rc1","v3.1rc2","v3.2a1","v3.2a2","v3.2a3","v3.2a4","v3.2b1","v3.2b2","v3.2rc1","v3.2rc2","v3.2rc3","v3.3.0a2","v3.3.0a3","v3.3.0a4","v3.3.0b1","v3.3.0b2","v3.3.0rc1","v3.3.0rc2","v3.3.0rc3","v3.4.0","v3.4.0a1","v3.4.0a2","v3.4.0a3","v3.4.0a4","v3.4.0b1","v3.4.0b2","v3.4.0b3","v3.4.0rc1","v3.4.0rc2","v3.4.0rc3","v3.4.1","v3.4.10rc1","v3.4.1rc1","v3.4.2rc1","v3.4.3","v3.4.3rc1","v3.4.5","v3.4.5rc1","v3.4.6","v3.4.6rc1","v3.4.7","v3.4.7rc1","v3.4.8","v3.4.8rc1","v3.4.9","v3.4.9rc1","v3.5.0a1","v3.5.0a2","v3.5.0a3","v3.5.0a4","v3.5.0b1","v3.5.0b3","v3.5.0b4","v3.5.0rc1","v3.5.0rc2","v3.5.0rc3","v3.5.1rc1","v3.5.2","v3.5.2rc1","v3.5.3","v3.5.3rc1","v3.5.4","v3.5.4rc1","v3.5.5","v3.5.5rc1","v3.5.6","v3.5.6rc1","v3.5.7rc1","v3.6.0a3","v3.6.0b1","v3.6.0b3","v3.6.0b4","v3.6.0rc1","v3.6.2rc1","v3.6.6rc1","v3.6.8","v3.6.8rc1","v3.6.9rc1","v3.7.0a2","v3.7.0b1","v3.7.0b2","v3.7.0b3","v3.7.0b4","v3.7.0b5","v3.7.0rc1","v3.7.2rc1","v3.7.3rc1"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-20852.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"}]}