Skip to main content
MEDIUM

CVE-2018-20852

CVSS v3

5.3

MEDIUM

EPSS Score

3.7 %

exploit probability, as of 2026-10-19

CISA KEV

No

known exploited

Exploitation

—

SSVC status

Get an alert for each new CVE published for python.

Set up CVE WatchFree account · no credit card

Affected and fixed versions

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • python2-attrsAlmaLinux:8all versions · fixed in 17.4.0-10.module_el8.6.0+2781+fed64c13
  • python2-chardetAlmaLinux:8all versions · fixed in 3.0.4-10.module_el8.6.0+2781+fed64c13
  • python2-coverageAlmaLinux:8all versions · fixed in 4.5.1-4.module_el8.6.0+2781+fed64c13
  • python2-CythonAlmaLinux:8all versions · fixed in 0.28.1-7.module_el8.6.0+2781+fed64c13
  • python2-dnsAlmaLinux:8all versions · fixed in 1.15.0-10.module_el8.6.0+2781+fed64c13
  • python2-docsAlmaLinux:8all versions · fixed in 2.7.16-2.module_el8.6.0+2781+fed64c13and 1 other package
  • python2-docutilsAlmaLinux:8all versions · fixed in 0.14-12.module_el8.6.0+2781+fed64c13
  • python2-funcsigsAlmaLinux:8all versions · fixed in 1.0.2-13.module_el8.6.0+2781+fed64c13

16 more package ranges on OSV.dev

Vendor advisories

  • CVE-2018-20852 Red Hat Product Security784 products fixed · 8 known affected

    python: Cookie domain check returns incorrect results

    python.src as a component of Red Hat Enterprise Linux 5 · python as a component of Red Hat Enterprise Linux 6 · python-devel as a component of Red Hat Enterprise Linux 6

  • RHSA-2020:1605 Red Hat Product Security264 products fixed

    Red Hat Security Advisory: python27:2.7 security, bug fix, and enhancement update

  • RHSA-2020:1764 Red Hat Product Security56 products fixed

    Red Hat Security Advisory: python3 security and bug fix update

  • RHBA-2020:1539 Red Hat Product Security1 product fixed

    Red Hat Bug Fix Advisory: Red Hat Ansible Tower 3.5.6-1 - RHEL7 Container

  • RHBA-2020:1540 Red Hat Product Security1 product fixed

    Red Hat Bug Fix Advisory: Red Hat Ansible Tower 3.6.4-1 - RHEL7 Container

  • RHSA-2020:1131 Red Hat Product Security79 products fixed

    Red Hat Security Advisory: python security update

3 more advisories

Full record on NVD

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.

Technical details

Published
2019-07-13

Frequently asked questions

What is CVE-2018-20852?

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.

Is CVE-2018-20852 actively exploited?

Active exploitation of CVE-2018-20852 has not been confirmed. Its EPSS score was 3.7% on 2026-10-19, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2018-20852?

CVE-2018-20852 has a CVSS v3 base score of 5.3 (MEDIUM severity).

Running python? Hear about its next vulnerability

CVE Watch matches each new CVE to the vendors and products you list (vendor and product, not the version) and puts it in your alerts with its KEV and EPSS status.

Already have an account? Open CVE WatchNo credit card required · No monthly cap on website lookups · 250 API requests/month