CVE-2014-5340
Remote code execution via pickle flaw in Check_MK before 1.2.4p4 and 1.2.5 before 1.2.5i4
- CVSS 9.3
- CWE-94 Improper Control of Generation of Code ('Code Injection')
- Input Validation and Sanitization
- Remote
The wato component in Check_MK before 1.2.4p4 and 1.2.5 before 1.2.5i4 uses the pickle Python module unsafely, which allows remote attackers to execute arbitrary code via a crafted serialized object, related to an automation URL.
- CVSS base score
- 9.3
- Published
- 2014-09-02
- OWASP
- A06 Vulnerable and Outdated Components
- 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 Check_MK to version 1.2.4p4 or 1.2.5i4 or higher.
Vulnerable code sample
import pickle
def load_data(serialized_data):
# Unsafe deserialization using pickle
return pickle.loads(serialized_data)
# Example of how to use the load_data function
def handle_request(serialized_data):
try:
# Deserialize the data unsafely
data = load_data(serialized_data)
# Process the data
print("Data processed:", data)
except Exception as e:
print("Error processing data:", e)
# Example of a crafted serialized object (this would be a pickle object)
crafted_data = b'\x80\x03}q\x00X\x03\x00\x00\x00keyq\x01X\x05\x00\x00\x00valueq\x02.'
handle_request(crafted_data)Patched code sample
import json
def safe_load(data):
# Use json instead of pickle to safely deserialize data
return json.loads(data)
# Example of how to use the safe_load function
def handle_request(serialized_data):
try:
# Deserialize the data safely
data = safe_load(serialized_data)
# Process the data
print("Data processed:", data)
except json.JSONDecodeError as e:
print("Invalid data:", e)
# Example of a crafted serialized object (in JSON format)
crafted_data = '{"key": "value"}'
handle_request(crafted_data)Cite this entry
@misc{vaitp:cve20145340,
title = {{Remote code execution via pickle flaw in Check_MK before 1.2.4p4 and 1.2.5 before 1.2.5i4}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2014},
note = {VAITP Python Vulnerability Dataset, entry CVE-2014-5340},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2014-5340/}}
}
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 ::
