VAITP Dataset

← Back to the dataset

CVE-2002-0131

ActivePython ActiveX control in AXScript allows remote file reading in Internet Explorer due to security flaws

  • CVSS 5.0
  • CWE-358: Improperly Implemented Security Check for Standard allows unprivileged code execution
  • Input Validation and Sanitization
  • Remote

ActivePython ActiveX control for Python in the AXScript package, when used in Internet Explorer, does not prevent a script from reading files from the client's filesystem, which allows remote attackers to read arbitrary files via a malicious web page containing Python script.

CVSS base score
5.0
Published
2002-03-25
OWASP
A01 Broken Access Control
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Path Traversal
Accessibility scope
Remote
Impact
Information Disclosure
Fixed by upgrading
Yes

Solution

Upgrade ActivePython ActiveX control to a secure version.

Vulnerable code sample

class ActiveXControl:
    def read_file(self, file_path):
        with open(file_path, 'r') as file:
            return file.read()

activex_control = ActiveXControl()
content = activex_control.read_file("C:/path/to/arbitrary/file.txt")
print(content)

Patched code sample

import os

class ActiveXControl:
    def __init__(self):
        self.allowed_paths = [os.path.expanduser("~")]

    def read_file(self, file_path):
        normalized_path = os.path.abspath(file_path)
        
        if any(normalized_path.startswith(os.path.abspath(allowed_path)) for allowed_path in self.allowed_paths):
            with open(normalized_path, 'r') as file:
                return file.read()
        else:
            raise PermissionError("Access to the requested file is denied.")

_control = ActiveXControl()
try:
    content = _control.read_file("C:/path/to/arbitrary/file.txt")
    print(content)
except PermissionError as e:
    print(e)

Cite this entry

@misc{vaitp:cve20020131,
  title        = {{ActivePython ActiveX control in AXScript allows remote file reading in Internet Explorer due to security flaws}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2002},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2002-0131},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2002-0131/}}
}
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 ::