{"id":693,"cve":"CVE-2013-5942","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2013-5942","cwe":"CWE-94 Improper Control of Generation of Code ('Code Injection')","cwe_number":94,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/94","cvss_score":6.8,"published":"2013-09-27","owasp":"A06 Vulnerable and Outdated Components","odc":"Timing\/Serialization","cdc":"Serialization Issues","category":"Input Validation and Sanitization","subcategory":"Insecure Parsing or Deserialization","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Graphite 0.9.5-0.9.10: Remote code execution via unsafe pickle","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2013-5942\/","description":"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, related to (1) remote_storage.py, (2) storage.py, (3) render\/datalib.py, and (4) whitelist\/views.py, a different vulnerability than CVE-2013-5093.","solution":"Update Graphite to version 0.9.11 or higher.","affected_component":"Python","fixed_by_upgrading":true,"vulnerable_code":"import pickle\n\ndef load_data(serialized_data):\n    # Unsafe deserialization using pickle\n    return pickle.loads(serialized_data)\n\n# Example of using the load_data function\ndef process_data(serialized_data):\n    try:\n        data = load_data(serialized_data)\n        # Process the data as needed\n    except Exception as e:\n        print(f\"Error processing data: {e}\")","patched_code":"import json\n\ndef safe_load(data):\n    # Use json instead of pickle to safely deserialize data\n    return json.loads(data)\n\n# Example of using the safe_load function\ndef process_data(serialized_data):\n    try:\n        data = safe_load(serialized_data)\n        # Process the data as needed\n    except json.JSONDecodeError:\n        print(\"Invalid data format\")","payload_needed":false,"payload":null,"payload_status":"none","published_fix":[],"references":null}