CVE-2013-5123
Python Pip < 1.5 Insecure DNS, mirroring support allows MITM attacks
- CVSS 5.9
- CWE-287 Improper Authentication
- Cryptographic
- Remote
The mirroring support (-M, –use-mirrors) in Python Pip before 1.5 uses insecure DNS querying and authenticity checks which allows attackers to perform man-in-the-middle attacks.
- CVSS base score
- 5.9
- Published
- 2019-11-05
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Cryptographic
- Subcategory
- Improper SSL/TLS Certificate Validation
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- pip
- Fixed by upgrading
- Yes
Solution
Update Python Pip to version 1.5 or higher.
Vulnerable code sample
import urllib.request
def insecure_download(url):
# Insecurely download data without SSL verification
response = urllib.request.urlopen(url)
data = response.read()
return data
# Example usage
url = "http://pypi.org/simple/"
data = insecure_download(url)
print(data)Patched code sample
import ssl
import urllib.request
def secure_download(url):
# Use HTTPS to ensure secure communication
context = ssl.create_default_context()
with urllib.request.urlopen(url, context=context) as response:
data = response.read()
return data
# Example usage
url = "https://pypi.org/simple/"
data = secure_download(url)
print(data)Cite this entry
@misc{vaitp:cve20135123,
title = {{Python Pip < 1.5 Insecure DNS, mirroring support allows MITM attacks}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2019},
note = {VAITP Python Vulnerability Dataset, entry CVE-2013-5123},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2013-5123/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
