CVE-2013-5093
Graphite 0.9.5 to 0.9.10 allows remote code execution via crafted serialized objects
- CVSS 6.8
- CWE-94 Improper Control of Generation of Code ('Code Injection')
- Input Validation and Sanitization
- Remote
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python module unsafely, which allows remote attackers to execute arbitrary code via a crafted serialized object.
- CVSS base score
- 6.8
- Published
- 2013-09-27
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Serialization Issues
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Python
- Fixed by upgrading
- Yes
Solution
Update to Graphite version 1.1.6 or higher.
Vulnerable code sample
import pickle
def renderLocalView(data):
# Vulnerable code using pickle to deserialize data unsafely
try:
# 'data' is expected to be a pickled object
deserialized_data = pickle.loads(data)
# Process the deserialized data
return process_data(deserialized_data)
except Exception as e:
raise ValueError("Error processing data: {}".format(e))Patched code sample
import json
def renderLocalView(data):
# Instead of using pickle, use json to safely deserialize data
try:
# Assuming 'data' is a JSON string that needs to be deserialized
deserialized_data = json.loads(data)
# Process the deserialized data safely
return process_data(deserialized_data)
except json.JSONDecodeError:
raise ValueError("Invalid data format")Cite this entry
@misc{vaitp:cve20135093,
title = {{Graphite 0.9.5 to 0.9.10 allows remote code execution via crafted serialized objects}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2013},
note = {VAITP Python Vulnerability Dataset, entry CVE-2013-5093},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2013-5093/}}
}
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 ::
