CVE-2020-27619

9.8 CRITICAL

📋 TL;DR

This vulnerability in Python's test suite allows remote code execution via eval() on untrusted HTTP content. It affects Python 3 through 3.9.0 when running the CJK codec tests. While primarily in test code, it could be exploited if test files are accessible.

💻 Affected Systems

Products:
  • Python
Versions: 3.0 through 3.9.0
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when running the specific test file Lib/test/multibytecodec_support.py or if this file is accessible to attackers.

📦 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 →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote attacker executes arbitrary code with the privileges of the Python process, potentially leading to full system compromise.

🟠

Likely Case

Limited impact since it's in test code, but could be exploited in development environments or if test files are exposed.

🟢

If Mitigated

No impact if test files are not accessible or Python is not running vulnerable test code.

🌐 Internet-Facing: LOW - Test files are typically not exposed to internet-facing systems.
🏢 Internal Only: MEDIUM - Development environments or improperly configured systems could be vulnerable.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires access to the test file and ability to trigger its execution with malicious HTTP content.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Python 3.9.1 and later

Vendor Advisory: https://bugs.python.org/issue41944

Restart Required: No

Instructions:

1. Upgrade Python to version 3.9.1 or later. 2. For older versions, apply the security patches from the GitHub commits referenced in the CVE.

🔧 Temporary Workarounds

Remove vulnerable test file

all

Delete or restrict access to the vulnerable test file to prevent exploitation.

rm /path/to/python/Lib/test/multibytecodec_support.py

Restrict network access

all

Prevent the test file from making HTTP requests by blocking outbound connections or using firewall rules.

🧯 If You Can't Patch

  • Ensure test files are not accessible or executable in production environments
  • Implement strict network controls to prevent the vulnerable code from making HTTP requests

🔍 How to Verify

Check if Vulnerable:

Check if Python version is between 3.0 and 3.9.0 and if the file Lib/test/multibytecodec_support.py exists and contains eval() calls with HTTP content.

Check Version:

python3 --version

Verify Fix Applied:

Verify Python version is 3.9.1 or later, or check that the vulnerable test file has been patched to remove the eval() on HTTP content.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Python test execution, especially involving HTTP requests to external sources
  • Unexpected eval() calls in Python processes

Network Indicators:

  • Outbound HTTP requests from Python test processes to unusual domains

SIEM Query:

process.name:python AND process.args:*multibytecodec_support* AND network.destination.port:80

🔗 References

📤 Share & Export