CVE-2011-4104
Django Tastypie < 0.9.10: Remote code execution via YAML deserialization
- CVSS 7.5
- CWE-20 Improper Input Validation
- Input Validation and Sanitization
- Local
The from_yaml method in serializers.py in Django Tastypie before 0.9.10 does not properly deserialize YAML data, which allows remote attackers to execute arbitrary Python code via vectors related to the yaml.load method.
- CVSS base score
- 7.5
- Published
- 2014-10-27
- OWASP
- A03 Injection
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Local
- Impact
- Arbitrary Code Execution
- Fixed by upgrading
- Yes
Solution
Update Django Tastypie to version 0.9.10 or higher.
Vulnerable code sample
import pickle
def load_data(data):
"""Load data - VULNERABLE to pickle RCE"""
# VULNERABILITY: pickle.loads can execute arbitrary code
return pickle.loads(data)
# Malicious payload can execute system commands
# when unpickledPatched code sample
import json
def load_data_secure(data):
"""Securely load data using JSON"""
try:
# SECURE: JSON only allows safe data types
return json.loads(data)
except json.JSONDecodeError:
return None
except Exception:
return NoneCite this entry
@misc{vaitp:cve20114104,
title = {{Django Tastypie < 0.9.10: Remote code execution via YAML deserialization}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2014},
note = {VAITP Python Vulnerability Dataset, entry CVE-2011-4104},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2011-4104/}}
}
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 ::
