CVE-2019-10160
📋 TL;DR
This CVE is a security regression of CVE-2019-9636 in Python's URL parsing that allows attackers to craft malicious URLs to trick applications into sending sensitive information (like cookies or authentication data) to unintended hosts. It affects Python applications that parse user-supplied URLs across multiple Python versions. The vulnerability enables credential/session theft and information disclosure.
💻 Affected Systems
- Python
- Applications using Python's urllib/urllib2/urllib.parse
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Fedora by Fedoraproject
Leap by Opensuse
Leap by Opensuse
Python by Python
Python is a high-level, interpreted programming language known for its readability and versatility. It is widely used in web development, data science, automation, and scientific computing.
Learn more about Python →Python by Python
Python is a high-level, interpreted programming language known for its readability and versatility. It is widely used in web development, data science, automation, and scientific computing.
Learn more about Python →Python by Python
Python is a high-level, interpreted programming language known for its readability and versatility. It is widely used in web development, data science, automation, and scientific computing.
Learn more about Python →Python by Python
Python is a high-level, interpreted programming language known for its readability and versatility. It is widely used in web development, data science, automation, and scientific computing.
Learn more about Python →Python by Python
Python is a high-level, interpreted programming language known for its readability and versatility. It is widely used in web development, data science, automation, and scientific computing.
Learn more about Python →Python by Python
Python is a high-level, interpreted programming language known for its readability and versatility. It is widely used in web development, data science, automation, and scientific computing.
Learn more about Python →Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
⚠️ Risk & Real-World Impact
Worst Case
Complete compromise of user sessions and authentication credentials leading to account takeover, data exfiltration, and lateral movement within affected systems.
Likely Case
Session hijacking and credential theft from applications that parse user-controlled URLs, potentially leading to unauthorized access to user accounts.
If Mitigated
Limited impact with proper input validation and URL sanitization, though underlying vulnerability remains present.
🎯 Exploit Status
Exploitation requires user interaction (clicking malicious URLs) but is technically simple once the malicious URL is crafted.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Python 2.7.17+, 3.5.10+, 3.6.11+, 3.7.6+, 3.8.0b2+
Vendor Advisory: https://access.redhat.com/errata/RHSA-2019:1587
Restart Required: Yes
Instructions:
1. Identify Python version with 'python --version'. 2. Update Python using system package manager (apt/yum/dnf). 3. Restart all Python applications and services. 4. Test URL parsing functionality.
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement strict validation and sanitization of user-supplied URLs before parsing
Use Alternative URL Parsing Libraries
allReplace Python's built-in URL parsing with validated third-party libraries
🧯 If You Can't Patch
- Implement strict input validation to reject malformed URLs
- Use web application firewalls (WAF) to detect and block malicious URL patterns
🔍 How to Verify
Check if Vulnerable:
Check Python version with 'python --version' and compare against affected versions. Test URL parsing with crafted test cases.
Check Version:
python --version
Verify Fix Applied:
Verify Python version is patched and test that malicious URL patterns no longer cause information leakage.
📡 Detection & Monitoring
Log Indicators:
- Unusual URL patterns in application logs
- Multiple failed authentication attempts from unexpected sources
- URLs with unusual characters in user/password sections
Network Indicators:
- Unexpected outbound connections to unusual domains
- Credentials being sent to non-standard ports or hosts
SIEM Query:
source="application.logs" AND (url="*@*" OR url="*%40*") AND dest_host!=expected_host
🔗 References
- http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00042.html
- http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html
- https://access.redhat.com/errata/RHSA-2019:1587
- https://access.redhat.com/errata/RHSA-2019:1700
- https://access.redhat.com/errata/RHSA-2019:2437
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-10160
- https://github.com/python/cpython/commit/250b62acc59921d399f0db47db3b462cd6037e09
- https://github.com/python/cpython/commit/8d0ef0b5edeae52960c7ed05ae8a12388324f87e
- https://github.com/python/cpython/commit/f61599b050c621386a3fc6bc480359e2d3bb93de
- https://github.com/python/cpython/commit/fd1771dbdd28709716bd531580c40ae5ed814468
- https://lists.apache.org/thread.html/r1b103833cb5bc8466e24ff0ecc5e75b45a705334ab6a444e64e840a0%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.debian.org/debian-lts-announce/2019/06/msg00022.html
- https://lists.debian.org/debian-lts-announce/2020/07/msg00011.html
- https://lists.debian.org/debian-lts-announce/2020/08/msg00034.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2ORNTF62QPLMJXIQ7KTZQ2776LMIXEKL/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/44TS66GJMO5H3RLMVZEBGEFTB6O2LJJU/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4X3HW5JRZ7GCPSR7UHJOLD7AWLTQCDVR/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/E2HP37NUVLQSBW3J735A2DQDOZ4ZGBLY/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ER6LONC2B2WYIO56GBQUDU6QTWZDPUNQ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HQEQLXLOCR3SNM3AA5RRYJFQ5AZBYJ4L/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JCPGLTTOBB3QEARDX4JOYURP6ELNNA2V/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KRYFIMISZ47NTAU3XWZUOFB7CYL62KES/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M34WOYCDKTDE5KLUACE2YIEH7D37KHRX/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NF3DRDGMVIRYNZMSLJIHNW47HOUQYXVG/
- https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization2.html
- https://security.netapp.com/advisory/ntap-20190617-0003/
- https://usn.ubuntu.com/4127-1/
- https://usn.ubuntu.com/4127-2/
- http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00042.html
- http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html
- https://access.redhat.com/errata/RHSA-2019:1587
- https://access.redhat.com/errata/RHSA-2019:1700
- https://access.redhat.com/errata/RHSA-2019:2437
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-10160
- https://github.com/python/cpython/commit/250b62acc59921d399f0db47db3b462cd6037e09
- https://github.com/python/cpython/commit/8d0ef0b5edeae52960c7ed05ae8a12388324f87e
- https://github.com/python/cpython/commit/f61599b050c621386a3fc6bc480359e2d3bb93de
- https://github.com/python/cpython/commit/fd1771dbdd28709716bd531580c40ae5ed814468
- https://lists.apache.org/thread.html/r1b103833cb5bc8466e24ff0ecc5e75b45a705334ab6a444e64e840a0%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.debian.org/debian-lts-announce/2019/06/msg00022.html
- https://lists.debian.org/debian-lts-announce/2020/07/msg00011.html
- https://lists.debian.org/debian-lts-announce/2020/08/msg00034.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2ORNTF62QPLMJXIQ7KTZQ2776LMIXEKL/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/44TS66GJMO5H3RLMVZEBGEFTB6O2LJJU/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4X3HW5JRZ7GCPSR7UHJOLD7AWLTQCDVR/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/E2HP37NUVLQSBW3J735A2DQDOZ4ZGBLY/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ER6LONC2B2WYIO56GBQUDU6QTWZDPUNQ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HQEQLXLOCR3SNM3AA5RRYJFQ5AZBYJ4L/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JCPGLTTOBB3QEARDX4JOYURP6ELNNA2V/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KRYFIMISZ47NTAU3XWZUOFB7CYL62KES/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M34WOYCDKTDE5KLUACE2YIEH7D37KHRX/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NF3DRDGMVIRYNZMSLJIHNW47HOUQYXVG/
- https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization2.html
- https://security.netapp.com/advisory/ntap-20190617-0003/
- https://usn.ubuntu.com/4127-1/
- https://usn.ubuntu.com/4127-2/