VAITP Dataset

← Back to the dataset

CVE-2005-3302

Blender 2.36's bvh_import.py allows arbitrary Python code execution via a .bvh file's hierarchy element

  • CVSS 7.3
  • CWE-94
  • Input Validation and Sanitization
  • Remote

Eval injection vulnerability in bvh_import.py in Blender 2.36 allows attackers to execute arbitrary Python code via a hierarchy element in a .bvh file, which is supplied to an eval function call.

CVSS base score
7.3
Published
2005-10-24
OWASP
A03 Injection
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Blender
Fixed by upgrading
Yes

Solution

Update Blender to version 2.37 or higher.

Vulnerable code sample

def import_bvh(file_path):
    with open(file_path, 'r') as file:
        # Assuming the file is read and parsed into a hierarchy element
        hierarchy_element = file.read()  # Placeholder for actual parsing logic
        
        # Vulnerable code using eval
        try:
            result = eval(hierarchy_element)
            # Continue processing with the result
        except Exception as e:
            print(f"Error processing the hierarchy element: {e}")

Patched code sample

import ast

def safe_eval(expr):
    # Use ast.literal_eval to safely evaluate expressions
    return ast.literal_eval(expr)

def import_bvh(file_path):
    with open(file_path, 'r') as file:
        # Assuming the file is read and parsed into a hierarchy element
        hierarchy_element = file.read()  # Placeholder for actual parsing logic
        
        # Instead of eval, use safe_eval
        try:
            result = safe_eval(hierarchy_element)
            # Continue processing with the result
        except (ValueError, SyntaxError) as e:
            print(f"Error processing the hierarchy element: {e}")

Cite this entry

@misc{vaitp:cve20053302,
  title        = {{Blender 2.36's bvh_import.py allows arbitrary Python code execution via a .bvh file's hierarchy element}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2005},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2005-3302},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2005-3302/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.