VAITP Dataset

← Back to the dataset

CVE-2012-5485

Unspecified vectors in Plone before 4.2.3 and 4.3 before beta 1 allow remote code execution via the admin interface

  • CVSS 6.8
  • CWE-94 Improper Control of Generation of Code ('Code Injection')
  • Input Validation and Sanitization
  • Remote

registerConfiglet.py in Plone before 4.2.3 and 4.3 before beta 1 allows remote attackers to execute Python code via unspecified vectors, related to the admin interface.

CVSS base score
6.8
Published
2014-09-30
OWASP
A03 Injection
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Plone
Fixed by upgrading
Yes

Solution

Update to Plone version 4.2.3 or higher.

Vulnerable code sample

def execute_user_code(user_input):
    # Vulnerable code that directly evaluates user input
    exec(user_input)

# Example usage
user_input = "__import__('os').system('ls')"  # This would be user-provided input
execute_user_code(user_input)

Patched code sample

# Example of a fix for the CVE-2012-5485 vulnerability

def secure_eval(user_input):
    # Use a safe evaluation method instead of eval
    # For demonstration, we raise an error on unsafe input
    if not is_safe_input(user_input):
        raise ValueError("Unsafe input detected")

    # Process the safe input
    # This is where the actual logic would go
    # For example, if the input was a command, we would execute it safely
    return process_input(user_input)

def is_safe_input(user_input):
    # Implement checks to ensure the input is safe
    # For demonstration, we'll just allow alphanumeric characters
    return user_input.isalnum()

def process_input(user_input):
    # Placeholder for safe input processing logic
    print(f"Processing safe input: {user_input}")

# Example usage
try:
    user_input = "exampleCommand"  # This would be user-provided input
    secure_eval(user_input)
except ValueError as e:
    print(e)

Cite this entry

@misc{vaitp:cve20125485,
  title        = {{Unspecified vectors in Plone before 4.2.3 and 4.3 before beta 1 allow remote code execution via the admin interface}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2014},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2012-5485},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2012-5485/}}
}

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.