python: Cookie domain check returns incorrect results
Published Jul 13, 2019
5.3
MEDIUMCVSS 3.0
EPSS 3.88%
Description
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.
Affected products
No data.
No data.
Red Hat Ansible Tower 3.5 for RHEL 7
ansible-tower-35/ansible-tower:3.5.6-1
Fixed · RHBA-2020:1539
Red Hat Ansible Tower 3.6 for RHEL 7
ansible-tower-36/ansible-tower:3.6.4-1
Fixed · RHBA-2020:1540
Red Hat Enterprise Linux 7
python-0:2.7.5-88.el7
Fixed · RHSA-2020:1131
Red Hat Enterprise Linux 7
python3-0:3.6.8-13.el7
Fixed · RHSA-2020:1132
Red Hat Enterprise Linux 8
python27:2.7-8020020200117110429.90f98d4f
Fixed · RHSA-2020:1605
Red Hat Enterprise Linux 8
python3-0:3.6.8-23.el8
Fixed · RHSA-2020:1764
Red Hat Enterprise Linux 8
python3-0:3.6.8-23.el8
Fixed · RHSA-2020:1764
Red Hat Software Collections for Red Hat Enterprise Linux 6
python27-python-0:2.7.17-2.el6
Fixed · RHSA-2019:3948
Red Hat Software Collections for Red Hat Enterprise Linux 6
rh-python36-python-0:3.6.9-2.el6
Fixed · RHSA-2019:3725
Red Hat Software Collections for Red Hat Enterprise Linux 7
python27-python-0:2.7.17-2.el7
Fixed · RHSA-2019:3948
Red Hat Software Collections for Red Hat Enterprise Linux 7
rh-python36-python-0:3.6.9-2.el7
Fixed · RHSA-2019:3725
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
python27-python-0:2.7.17-2.el7
Fixed · RHSA-2019:3948
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
rh-python36-python-0:3.6.9-2.el7
Fixed · RHSA-2019:3725
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
python27-python-0:2.7.17-2.el7
Fixed · RHSA-2019:3948
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
rh-python36-python-0:3.6.9-2.el7
Fixed · RHSA-2019:3725
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS
python27-python-0:2.7.17-2.el7
Fixed · RHSA-2019:3948
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS
rh-python36-python-0:3.6.9-2.el7
Fixed · RHSA-2019:3725
Red Hat Enterprise Linux 5
python
Out of support scope
Red Hat Enterprise Linux 6
python
Out of support scope
Red Hat Enterprise Linux 8
python36:3.6/python36
Not affected
Red Hat Quay 3
python27
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Ansible Tower 3.5 for RHEL 7 | ansible-tower-35/ansible-tower:3.5.6-1 | Fixed | RHBA-2020:1539 |
| Red Hat Ansible Tower 3.6 for RHEL 7 | ansible-tower-36/ansible-tower:3.6.4-1 | Fixed | RHBA-2020:1540 |
| Red Hat Enterprise Linux 7 | python-0:2.7.5-88.el7 | Fixed | RHSA-2020:1131 |
| Red Hat Enterprise Linux 7 | python3-0:3.6.8-13.el7 | Fixed | RHSA-2020:1132 |
| Red Hat Enterprise Linux 8 | python27:2.7-8020020200117110429.90f98d4f | Fixed | RHSA-2020:1605 |
| Red Hat Enterprise Linux 8 | python3-0:3.6.8-23.el8 | Fixed | RHSA-2020:1764 |
| Red Hat Enterprise Linux 8 | python3-0:3.6.8-23.el8 | Fixed | RHSA-2020:1764 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6 | python27-python-0:2.7.17-2.el6 | Fixed | RHSA-2019:3948 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6 | rh-python36-python-0:3.6.9-2.el6 | Fixed | RHSA-2019:3725 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | python27-python-0:2.7.17-2.el7 | Fixed | RHSA-2019:3948 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | rh-python36-python-0:3.6.9-2.el7 | Fixed | RHSA-2019:3725 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS | python27-python-0:2.7.17-2.el7 | Fixed | RHSA-2019:3948 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS | rh-python36-python-0:3.6.9-2.el7 | Fixed | RHSA-2019:3725 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS | python27-python-0:2.7.17-2.el7 | Fixed | RHSA-2019:3948 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS | rh-python36-python-0:3.6.9-2.el7 | Fixed | RHSA-2019:3725 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS | python27-python-0:2.7.17-2.el7 | Fixed | RHSA-2019:3948 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS | rh-python36-python-0:3.6.9-2.el7 | Fixed | RHSA-2019:3725 |
| Red Hat Enterprise Linux 5 | python | Out of support scope | n/a |
| Red Hat Enterprise Linux 6 | python | Out of support scope | n/a |
| Red Hat Enterprise Linux 8 | python36:3.6/python36 | Not affected | n/a |
| Red Hat Quay 3 | python27 | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
This issue affects the versions of python as shipped with Red Hat Enterprise Linux 5, 6, and 7. This issue affects the versions of python3 as shipped with Red Hat Enterprise Linux 7 and 8. This issue affects the versions of python2 and python36 as shipped with Red Hat Enterprise Linux 8. Red Hat Enterprise Linux 5 is now in Extended Life Phase of the support and maintenance life cycle. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/. Red Hat Enterprise Linux 6 is now in Maintenance Support 2 Phase of the support and maintenance life cycle. This has been rated as having a security impact of Moderate, and is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.
Red Hat mitigation
A potentially simple workaround in the absence of patch on affected versions is to set DomainStrict in the cookiepolicy that would make sure a literal match against domain. The disadvantage would be that cookie set on example.com would not be shared with subdomain which might break workflow.
Metrics
No CVSS v4.0 score for this CVE.
No CVSS v3.1 score for this CVE.
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
AV:N/AC:L/Au:N/C:P/I:N/A:N
This CVE is not in the KEV list.
No CISA SSVC assessment for this CVE yet.
Estimated probability of exploitation in the wild in the next 30 days (FIRST EPSS). As of Oct 1, 2026.
Score over time
2021–2026- EPSS v1
- EPSS v5
- EPSS v2
- EPSS v3
- EPSS v4
Percentile over time
- EPSS v1
- EPSS v5
- EPSS v2
- EPSS v3
- EPSS v4
Table of values (16 key points)
Flat stretches are collapsed; showing up to 120 newest points.
| Date | Score | Percentile | Model |
|---|---|---|---|
| Oct 1, 2026 | 3.88% (0.03880) | 89.90th | v5 (v2026.06.15) |
| Jun 15, 2026 | 3.88% (0.03880) | 88.83th | v5 (v2026.06.15) |
| Dec 18, 2025 | 2.08% (0.02079) | 83.51th | v4 (v2025.03.14) |
| Nov 21, 2025 | 0.97% (0.00967) | 75.88th | v4 (v2025.03.14) |
| Nov 18, 2025 | 4.18% (0.04182) | 87.57th | v4 (v2025.03.14) |
| Mar 30, 2025 | 1.00% (0.01004) | 75.01th | v4 (v2025.03.14) |
| Mar 29, 2025 | 3.31% (0.03306) | 78.53th | v4 (v2025.03.14) |
| Mar 17, 2025 | 1.00% (0.01004) | 75.48th | v4 (v2025.03.14) |
| Dec 12, 2024 | 0.52% (0.00515) | 77.47th | v3 (v2023.03.01) |
| Jul 6, 2024 | 0.52% (0.00515) | 76.83th | v3 (v2023.03.01) |
| Feb 8, 2024 | 0.48% (0.00484) | 75.26th | v3 (v2023.03.01) |
| Mar 7, 2023 | 0.48% (0.00484) | 72.23th | v3 (v2023.03.01) |
| Mar 6, 2023 | 2.69% (0.02686) | 82.85th | v2 (v2022.01.01) |
| Feb 4, 2022 | 2.69% (0.02686) | 62.66th | v2 (v2022.01.01) |
| Feb 3, 2022 | 3.88% (0.03876) | 72.87th | v5 (v2026.06.15) |
| Apr 14, 2021 | 3.88% (0.03876) | 0.00th | v1 |
References (22)
- http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00071.html vendor-advisoryx_refsource_SUSE
- http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00074.html vendor-advisoryx_refsource_SUSE
- http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html vendor-advisoryx_refsource_SUSE
- https://access.redhat.com/errata/RHSA-2019:3725 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2019:3948 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2018-20852 Vendor Advisory
- https://bugs.python.org/issue35121 x_refsource_MISCExploitIssue TrackingVendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=1740347 Issue Tracking
- https://lists.debian.org/debian-lts-announce/2019/08/msg00022.html mailing-listx_refsource_MLIST
- https://lists.debian.org/debian-lts-announce/2019/08/msg00040.html mailing-listx_refsource_MLIST
- https://lists.debian.org/debian-lts-announce/2020/07/msg00011.html mailing-listx_refsource_MLIST
- https://lists.debian.org/debian-lts-announce/2020/08/msg00034.html mailing-listx_refsource_MLIST
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/COATURTCY7G67AYI6UDV5B2JZTBCKIDX/ vendor-advisoryx_refsource_FEDORA
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/K7HNVIFMETMFWWWUNTB72KYJYXCZOS5V/ vendor-advisoryx_refsource_FEDORA
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZBTGPBUABGXZ7WH7677OEM3NSP6ZEA76/ vendor-advisoryx_refsource_FEDORA
- https://nvd.nist.gov/vuln/detail/CVE-2018-20852
- https://python-security.readthedocs.io/vuln/cookie-domain-check.html x_refsource_MISCVendor Advisory
- https://security.gentoo.org/glsa/202003-26 vendor-advisoryx_refsource_GENTOO
- https://usn.ubuntu.com/4127-1/ vendor-advisoryx_refsource_UBUNTU
- https://usn.ubuntu.com/4127-2/ vendor-advisoryx_refsource_UBUNTU
- https://www.cve.org/CVERecord?id=CVE-2018-20852
- https://www.oracle.com/security-alerts/cpuapr2020.html x_refsource_MISC
Change history (0)
No recorded changes yet.