CVE-2012-5488
Plone < 4.2.3 & 4.3 beta 1: Remote code execution via crafted URL and createObject
- 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 createObject.
- CVSS base score
- 5.0
- Published
- 2014-09-30
- OWASP
- A03 Injection
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Direct Object References (IDOR)
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Plone
- Fixed by upgrading
- Yes
Solution
Update Plone to version 4.2.3 or 4.3 beta 1 or higher.
Vulnerable code sample
def create_object(context, type_name, id, **kwargs):
# Directly using createObject without permission checks
obj = context.portal_skins.custom.createObject(type_name, id, **kwargs)
return objPatched code sample
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.exceptions import Unauthorized
def safe_create_object(context, type_name, id, **kwargs):
# Ensure that the user has permission to create the object
if not context.checkPermission('Add portal content', context):
raise Unauthorized("You do not have permission to create this object.")
# Create the object safely
portal_types = getToolByName(context, 'portal_types')
if type_name in portal_types.listTypeInfo():
new_object = portal_types.constructContent(type_name, context, id, **kwargs)
return new_object
else:
raise ValueError("Invalid type name provided.")Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- various security fixes based on PloneHotfix20121106 (plone/Products.CMFPlone)
Products/CMFPlone/patches/__init__.py,Products/CMFPlone/PloneControlPanel.py,Products/CMFPlone/PloneTool.py,Products/CMFPlone/skins/plone_scripts/formatColumns.py,Products/CMFPlone/skins/plone_scripts/getFolderContents.py,Products/CMFPlone/skins/plone_scripts/translate.py - various security fixes based on PloneHotfix20121106 (plone/Products.CMFPlone)
Products/CMFPlone/skins/plone_scripts/translate.py
Cite this entry
@misc{vaitp:cve20125488,
title = {{Plone < 4.2.3 & 4.3 beta 1: Remote code execution via crafted URL and createObject}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2014},
note = {VAITP Python Vulnerability Dataset, entry CVE-2012-5488},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2012-5488/}}
}
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 ::
