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...
Medium CVSS 4.3
- CVE id
- CVE-2018-20852
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| Python Runtimes and servers |
>= 2.0, <= 2.7.16 >= 3.0.0, < 3.4.10 >= 3.5.0, < 3.5.7 >= 3.6.0, < 3.6.9 >= 3.7.0, < 3.7.3 |
3.4.10, 3.5.7, 3.6.9, 3.7.3 |
How to fix it
Upgrade Python to the fixed release of the line you run: 3.4.10, 3.5.7, 3.6.9, 3.7.3.
python --version
- Install the patched Python release of your minor line (pyenv, the python image tag, or your OS packages) and recreate virtual environments.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
http.cookiejar.DefaultPolicy.domainreturnok 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.
References
- CVE-2018-20852 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2018-20852
- Web: https://access.redhat.com/errata/RHSA-2019:3725
- Web: https://access.redhat.com/errata/RHSA-2019:3948
- Web: https://bugs.python.org/issue35121
- Web: https://lists.debian.org/debian-lts-announce/2019/08/msg00022.html
- Web: https://lists.debian.org/debian-lts-announce/2019/08/msg00040.html
- Web: https://lists.debian.org/debian-lts-announce/2020/07/msg00011.html
- Web: https://lists.debian.org/debian-lts-announce/2020/08/msg00034.html
- Web: https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/COATURTCY7G67AYI6UDV5B2JZTBCKIDX/
- Web: https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/K7HNVIFMETMFWWWUNTB72KYJYXCZOS5V/
- Web: https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZBTGPBUABGXZ7WH7677OEM3NSP6ZEA76/
- Web: https://python-security.readthedocs.io/vuln/cookie-domain-check.html
- Web: https://security.gentoo.org/glsa/202003-26
- Web: https://usn.ubuntu.com/4127-1/
- Web: https://usn.ubuntu.com/4127-2/
- Web: https://www.oracle.com/security-alerts/cpuapr2020.html
- Web: https://access.redhat.com/errata/RHSA-2019:3725
- Web: https://access.redhat.com/errata/RHSA-2019:3948
- Web: https://bugs.python.org/issue35121
- Web: https://lists.debian.org/debian-lts-announce/2019/08/msg00022.html
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.