VAITP Dataset

← Back to the dataset

CVE-2012-0955

TLS certificate validation vulnerability in software-properties (before version 0.92)

  • CVSS 7.4
  • CWE-295: Improper Certificate Validation
  • Cryptographic
  • Remote

software-properties was vulnerable to a person-in-the-middle attack due to incorrect TLS certificate validation in softwareproperties/ppa.py. software-properties didn't check TLS certificates under python2 and only checked certificates under python3 if a valid certificate bundle was provided. Fixed in software-properties version 0.92.

CVSS base score
7.4
Published
2020-12-02
OWASP
A05 Security Misconfiguration
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Cryptographic
Subcategory
Improper SSL/TLS Certificate Validation
Accessibility scope
Remote
Impact
Information Disclosure
Fixed by upgrading
Yes

Solution

Update to software-properties version 0.92 or higher

Vulnerable code sample

import urllib.request

def fetch_data(url):
    response = urllib.request.urlopen(url)
    return response.read()

url = "https://example.com/data"
data = fetch_data(url)
print(data)

Patched code sample

import ssl
import urllib.request

def fetch_data(url):
    context = ssl.create_default_context()

    with urllib.request.urlopen(url, context=context) as response:
        return response.read()

url = "https://example.com/data"
data = fetch_data(url)
print(data)

Cite this entry

@misc{vaitp:cve20120955,
  title        = {{TLS certificate validation vulnerability in software-properties (before version 0.92)}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2020},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2012-0955},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2012-0955/}}
}
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 ::