VAITP Dataset

← Back to the dataset

CVE-2008-5102

Denial of service in PythonScripts in Zope 2 (2.11.2 and earlier) via raise or import statements

  • CVSS 4.0
  • CWE-399
  • Resource Management
  • Remote

PythonScripts in Zope 2 2.11.2 and earlier, as used in Conga and other products, allows remote authenticated users to cause a denial of service (resource consumption or application halt) via certain (1) raise or (2) import statements.

CVSS base score
4.0
Published
2008-11-17
OWASP
A01 Broken Access Control
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Fixed by upgrading
Yes

Solution

Update to Zope 2 version 2.11.3 or higher

Vulnerable code sample

def execute_user_script(script):
    """Vulnerable function that demonstrates the security issue."""
    exec(script)

user_script = """
import time

while True:
    time.sleep(1)
"""

execute_user_script(user_script)

Patched code sample

import subprocess
import tempfile
import os

def execute_user_script(script, timeout=2):
    """Secure function that fixes the vulnerability."""
    # SECURE: This version prevents command injection
    with tempfile.NamedTemporaryFile(mode="w+", suffix=".py", delete=False) as tmp:
        tmp.write(script)
        tmp_path = tmp.name

    try:
        result = subprocess.run(
            ["python", tmp_path],
            capture_output=True,
            text=True,
            timeout=timeout
        )
        print(result.stdout or result.stderr)
    except subprocess.TimeoutExpired:
        print("Error: Script execution timed out.")
    except Exception as e:
        print(f"An error occurred: {e}")
    finally:
        os.remove(tmp_path)

user_script = """
import time
while True:
    time.sleep(1)
"""

execute_user_script(user_script)

Cite this entry

@misc{vaitp:cve20085102,
  title        = {{Denial of service in PythonScripts in Zope 2 (2.11.2 and earlier) via raise or import statements}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2008},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2008-5102},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2008-5102/}}
}
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 ::