CVE-2018-20852 json
http.cookiejar.DefaultPolicy.domain_return_ok in Lib/http/cookiejar.py in Python before 3.7.3 does not correctly validate the domain: it ca…
published 2019-07-13 7 y ago modified 2026-10-07 32 d ago also EUVD-2018-13392
- cvss
- 4.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 3.7%
- EPSS 3.7% chance of exploitation in 30 days, percentile 89%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- python python 3.4.10, 3.5.7, 3.6.9, 3.7.3
- python2.7 Debian 11 2.7.16-3
debian advisories DEBIAN-CVE-2018-20852
- python2.7 Ubuntu 16.04 LTS 2.7.12-1ubuntu0~16.04.8
- python2.7 Ubuntu 18.04 LTS 2.7.15-4ubuntu4~18.04.1
- python3.5 Ubuntu 16.04 LTS 3.5.2-2ubuntu0~16.04.8
- python3.6 Ubuntu 18.04 LTS 3.6.8-1~18.04.2
- python2.7 Ubuntu Pro 14.04 LTS 2.7.6-8ubuntu0.6+esm2
- python3.4 Ubuntu Pro 14.04 LTS 3.4.3-1ubuntu1~14.04.7+esm2
- python3.5 Ubuntu Pro 14.04 LTS 3.5.2-2ubuntu0~16.04.4~14.04.1+esm1
ubuntu advisories UBUNTU-CVE-2018-20852
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- pytz RHEL 8 2017.2-12.module+el8.1.0+3111+de3f2d8e
- babel RHEL 8 2.5.1-9.module+el8.1.0+3111+de3f2d8e
- numpy RHEL 8 1:1.14.2-13.module+el8.1.0+3323+7ac3e00f
- scipy RHEL 8 1.0.0-20.module+el8.1.0+3323+7ac3e00f
- Cython RHEL 8 0.28.1-7.module+el8.1.0+3111+de3f2d8e
- pytest RHEL 8 3.4.2-13.module+el8.1.0+3111+de3f2d8e
- PyYAML RHEL 8 3.12-16.module+el8.1.0+3111+de3f2d8e
- python2 RHEL 8 2.7.17-1.module+el8.2.0+4561+f4e0d66a
red hat advisories RHSA-2020:1605RHSA-2019:3725RHSA-2020:1764RHSA-2020:1132RHSA-2020:1131RHSA-2019:3948
- python3 SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES for SAP 12 SP3 +16 more 3.4.10-25.52.1
- python3-base SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES for SAP 12 SP3 +16 more 3.4.10-25.52.1
- python36 SLES for SAP 12 SP5, SLES 12 SP5 3.6.10-4.3.5
- python36-base SLES for SAP 12 SP5, SLES 12 SP5 3.6.10-4.3.5
- python SLE Module for Python 2 15 SP1, SLE Module for Desktop Applications 15 SP1, SLE Module for Desktop Applications 15 +2 more 2.7.17-7.32.2
- python-base SLE Module for Python 2 15 SP1, SLE Module for Basesystem 15 SP1, SLE Module for Basesystem 15 2.7.17-7.32.1
- python3 SLE Module for Basesystem 15 SP1, SLE Module for Basesystem 15 3.6.10-3.42.2
- python3-base SLE Module for Development Tools 15 SP1, SLE Module for Development Tools 15, SLE Module for Basesystem 15 SP1 +1 more 3.6.10-3.42.2
suse advisories SUSE-SU-2020:2699-1SUSE-SU-2020:0302-1SUSE-SU-2020:0234-1SUSE-SU-2019:14246-1SUSE-SU-2020:0114-1SUSE-SU-2019:2798-1
- python openSUSE Tumbleweed 2.7.18-8.1
- python36 openSUSE Tumbleweed 3.6.15-1.1
- python3 openSUSE Leap 15.1 3.6.10-lp151.6.7.1
- python3-base openSUSE Leap 15.1 3.6.10-lp151.6.7.1
- python openSUSE Leap 15.1 2.7.14-lp151.10.7.1
- python-base openSUSE Leap 15.1 2.7.14-lp151.10.7.1
- python openSUSE Leap 15.0 2.7.14-lp150.6.17.1
opensuse advisories openSUSE-SU-2024:11202-1openSUSE-SU-2024:11284-1openSUSE-SU-2020:0086-1openSUSE-SU-2019:1989-1openSUSE-SU-2019:1988-1
- python2-py AlmaLinux 8 1.5.3-6.module_el8.6.0+2781+fed64c13
- python2-dns AlmaLinux 8 1.15.0-10.module_el8.6.0+2781+fed64c13
- python2-idna AlmaLinux 8 2.5-7.module_el8.6.0+2781+fed64c13
- python2-mock AlmaLinux 8 2.0.0-13.module_el8.6.0+2781+fed64c13
- python2-pytz AlmaLinux 8 2017.2-12.module_el8.6.0+2781+fed64c13
- python2-attrs AlmaLinux 8 17.4.0-10.module_el8.6.0+2781+fed64c13
- python2-Cython AlmaLinux 8 0.28.1-7.module_el8.6.0+2781+fed64c13
- python2-pluggy AlmaLinux 8 0.6.0-8.module_el8.6.0+2781+fed64c13
almalinux advisories ALSA-2020:1605
- pytz Rocky Linux 8 2017.2-12.module+el8.5.0+706+735ec4b3
- pytz Rocky Linux 8 2017.2-12.module+el8.4.0+403+9ae17a31
- babel Rocky Linux 8 2.5.1-9.module+el8.4.0+403+9ae17a31
- scipy Rocky Linux 8 1.0.0-20.module+el8.3.0+120+426d8baf
- Cython Rocky Linux 8 0.28.1-7.module+el8.5.0+706+735ec4b3
- Cython Rocky Linux 8 0.28.1-7.module+el8.4.0+403+9ae17a31
- pytest Rocky Linux 8 3.4.2-13.module+el8.5.0+706+735ec4b3
- pytest Rocky Linux 8 3.4.2-13.module+el8.4.0+403+9ae17a31
rocky linux advisories RLSA-2020:1605
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2018-20852 updated cvss 5.3
python: Cookie domain check returns incorrect results
-
Red Hat Enterprise Linux 5 python Red Hat Enterprise Linux 6 python, tkinter, python-libs, python-test, python-toolsaffected: workaround, no fix planned “Out of support scope”
-
Red Hat Ansible Tower 3.5 for RHEL 7 Server ansible-tower-35/ansible-tower 3.5.6-1fixed: vendor fix RHBA-2020:1539
-
Red Hat Ansible Tower 3.6 for RHEL 7 ansible-tower-36/ansible-tower 3.6.4-1fixed: vendor fix RHBA-2020:1540
-
Red Hat Enterprise Linux AppStream (v. 8) python3-idle 3.6.8-23.el8, python3-test 3.6.8-23.el8, platform-python 3.6.8-23.el8, python3-tkinter 3.6.8-23.el8, babel 2.5.1-9.module+el8.1.0+3111+de3f2d8e, pytz 2017.2-12.module+el8.1.0+3111+de3f2d8e, +88 morefixed: vendor fix RHSA-2020:1605
-
Red Hat Enterprise Linux BaseOS (v. 8) python3 3.6.8-23.el8, python3-libs 3.6.8-23.el8, python3-test 3.6.8-23.el8, platform-python 3.6.8-23.el8fixed: vendor fix RHSA-2020:1764
-
Red Hat Enterprise Linux Client (v. 7) python 2.7.5-88.el7, python3 3.6.8-13.el7, python-libs 2.7.5-88.el7, python3-libs 3.6.8-13.el7 Red Hat Enterprise Linux Client Optional (v. 7) python3 3.6.8-13.el7, tkinter 2.7.5-88.el7, python-test 2.7.5-88.el7, python-tools 2.7.5-88.el7, python3-idle 3.6.8-13.el7, python3-test 3.6.8-13.el7, +1 more Red Hat Enterprise Linux ComputeNode (v. 7) python 2.7.5-88.el7, python3 3.6.8-13.el7, python-libs 2.7.5-88.el7, python3-libs 3.6.8-13.el7 Red Hat Enterprise Linux ComputeNode Optional (v. 7) python3 3.6.8-13.el7, tkinter 2.7.5-88.el7, python-test 2.7.5-88.el7, python-tools 2.7.5-88.el7, python3-idle 3.6.8-13.el7, python3-test 3.6.8-13.el7, +1 more Red Hat Enterprise Linux Server (v. 7) python 2.7.5-88.el7, python3 3.6.8-13.el7, python-libs 2.7.5-88.el7, python3-libs 3.6.8-13.el7 Red Hat Enterprise Linux Server Optional (v. 7) python3 3.6.8-13.el7, tkinter 2.7.5-88.el7, python-test 2.7.5-88.el7, python-tools 2.7.5-88.el7, python3-idle 3.6.8-13.el7, python3-test 3.6.8-13.el7, +1 morefixed: vendor fix RHSA-2020:1131
+2 more productsfewer
Red Hat Enterprise Linux Workstation (v. 7) python 2.7.5-88.el7, python3 3.6.8-13.el7, python-libs 2.7.5-88.el7, python3-libs 3.6.8-13.el7 Red Hat Enterprise Linux Workstation Optional (v. 7) python3 3.6.8-13.el7, tkinter 2.7.5-88.el7, python-test 2.7.5-88.el7, python-tools 2.7.5-88.el7, python3-idle 3.6.8-13.el7, python3-test 3.6.8-13.el7, +1 more -
Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 6) python27-python 2.7.17-2.el6, python27-tkinter 2.7.17-2.el6, rh-python36-python 3.6.9-2.el6, python27-python-libs 2.7.17-2.el6, python27-python-test 2.7.17-2.el6, python27-python-tools 2.7.17-2.el6, +4 more Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) python27-python 2.7.17-2.el7, python27-tkinter 2.7.17-2.el7, rh-python36-python 3.6.9-2.el7, python27-python-libs 2.7.17-2.el7, python27-python-test 2.7.17-2.el7, python27-python-tools 2.7.17-2.el7, +4 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.5) python27-python 2.7.17-2.el7, python27-tkinter 2.7.17-2.el7, rh-python36-python 3.6.9-2.el7, python27-python-libs 2.7.17-2.el7, python27-python-test 2.7.17-2.el7, python27-python-tools 2.7.17-2.el7, +4 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.6) python27-python 2.7.17-2.el7, python27-tkinter 2.7.17-2.el7, rh-python36-python 3.6.9-2.el7, python27-python-libs 2.7.17-2.el7, python27-python-test 2.7.17-2.el7, python27-python-tools 2.7.17-2.el7, +4 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) python27-python 2.7.17-2.el7, python27-tkinter 2.7.17-2.el7, rh-python36-python 3.6.9-2.el7, python27-python-libs 2.7.17-2.el7, python27-python-test 2.7.17-2.el7, python27-python-tools 2.7.17-2.el7, +4 more Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 6) python27-python 2.7.17-2.el6, python27-tkinter 2.7.17-2.el6, rh-python36-python 3.6.9-2.el6, python27-python-libs 2.7.17-2.el6, python27-python-test 2.7.17-2.el6, python27-python-tools 2.7.17-2.el6, +4 morefixed: vendor fix RHSA-2019:3948
+1 more productsfewer
Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) python27-python 2.7.17-2.el7, python27-tkinter 2.7.17-2.el7, rh-python36-python 3.6.9-2.el7, python27-python-libs 2.7.17-2.el7, python27-python-test 2.7.17-2.el7, python27-python-tools 2.7.17-2.el7, +4 more -
Red Hat Enterprise Linux 8 scipy, python36, python-nose, python-wheel, python3-bson, python3-nose, +19 more Red Hat Quay 3 python27not affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 32 d ago
Exploit prediction
3.67% chance of exploitation in the next 30 days, higher than 89% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- bugs.python.org https://bugs.python.org/issue35121 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 4.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N |
| CNA | 3.1 | 4.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N |
| NVD | 3.0 | 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
Classification
- Weakness
-
- CWE-20 Improper Input Validation
References
-
bugs.python.org
/issue35121
exploit, issue-tracking, vendor-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-08/msg00071.html
vendor-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-08/msg00074.html
vendor-advisory
-
usn.ubuntu.com
/4127-2/
vendor-advisory
-
usn.ubuntu.com
/4127-1/
vendor-advisory
-
access.redhat.com
/errata/RHSA-2019:3725
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/K7HNVIFMETMFWWWUNTB72KYJYXCZOS5V/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/ZBTGPBUABGXZ7WH7677OEM3NSP6ZEA76/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/COATURTCY7G67AYI6UDV5B2JZTBCKIDX/
vendor-advisory
-
access.redhat.com
/errata/RHSA-2019:3948
vendor-advisory
-
lists.opensuse.org
/opensuse-security-announce/2020-01/msg00040.html
vendor-advisory
-
security.gentoo.org
/glsa/202003-26
vendor-advisory
-
python-security.readthedocs.io
/vuln/cookie-domain-check.html
vendor-advisory
-
lists.debian.org
/debian-lts-announce/2019/08/msg00022.html
mailing-list
-
lists.debian.org
/debian-lts-announce/2019/08/msg00040.html
mailing-list
- oracle.com /security-alerts/cpuapr2020.html
-
lists.debian.org
/debian-lts-announce/2020/07/msg00011.html
mailing-list
-
lists.debian.org
/debian-lts-announce/2020/08/msg00034.html
mailing-list
Sources
- CVE List CVE-2018-20852
- NVD CVE-2018-20852
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.