CVE-2012-5495
Remote code execution in Plone versions before 4.2.3 and 4.3 beta 1 via a crafted URL
- CVSS 5.0
- CWE-94 Improper Control of Generation of Code ('Code Injection')
- Input Validation and Sanitization
- Remote
python_scripts.py in Plone before 4.2.3 and 4.3 before beta 1 allows remote attackers to execute Python code via a crafted URL, related to "go_back."
- CVSS base score
- 5.0
- Published
- 2014-09-30
- OWASP
- A10 Server-Side Request Forgery (SSRF)
- 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
- Python
- Fixed by upgrading
- Yes
Solution
Update Plone to version 4.2.3 or higher.
Vulnerable code sample
def execute_script(script):
# Vulnerable code that executes user-provided script without validation
exec(script) # This allows arbitrary code execution
# Example usage
user_input = "import os; os.system('echo Vulnerable!')" # Example of user input
execute_script(user_input)Patched code sample
def safe_execute_script(script):
# Validate the script content to prevent code injection
allowed_commands = ['print', 'len', 'sum'] # Example of allowed commands
if any(command in script for command in allowed_commands):
exec(script) # Only execute if the script is safe
else:
raise ValueError("Unsafe script content detected.")
# Example usage
try:
user_input = "print('Hello, World!')" # Example of user input
safe_execute_script(user_input)
except ValueError as e:
print(e)Cite this entry
@misc{vaitp:cve20125495,
title = {{Remote code execution in Plone versions before 4.2.3 and 4.3 beta 1 via a crafted URL}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2014},
note = {VAITP Python Vulnerability Dataset, entry CVE-2012-5495},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2012-5495/}}
}
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 ::
