CVE-2019-10160

9.8 CRITICAL

📋 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

Products:
  • Python
  • Applications using Python's urllib/urllib2/urllib.parse
Versions: Python 2.7, 3.5, 3.6, 3.7, and 3.8.0a4 through 3.8.0b1
Operating Systems: All operating systems running affected Python versions
Default Config Vulnerable: ⚠️ Yes
Notes: Applications must parse user-supplied URLs using Python's URL parsing libraries to be vulnerable.

📦 What is this software?

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 →

⚠️ 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.

🌐 Internet-Facing: HIGH - Any internet-facing application parsing user-supplied URLs is vulnerable to exploitation.
🏢 Internal Only: MEDIUM - Internal applications could be exploited through phishing or compromised internal users.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

all

Implement strict validation and sanitization of user-supplied URLs before parsing

Use Alternative URL Parsing Libraries

all

Replace 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

📤 Share & Export