CVE-2015-0693
Cisco WSA 8.5.0-ise-147: Local users can run Python code via a crafted pickle file
- CVSS 7.2
- CWE-20 Improper Input Validation
- Input Validation and Sanitization
- Local
Cisco Web Security Appliance (WSA) devices with software 8.5.0-ise-147 do not properly restrict use of the pickle Python module during certain tunnel-status checks, which allows local users to execute arbitrary Python code and gain privileges via a crafted pickle file, aka Bug ID CSCut39259.
- CVSS base score
- 7.2
- Published
- 2015-04-15
- OWASP
- A08 Software and Data Integrity Failures
- 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
- Affected component
- Python
- Fixed by upgrading
- Yes
Solution
Update Cisco WSA software to version 8.5.1-ise-149 or higher.
Vulnerable code sample
import pickle
def load_pickle(data):
# Directly unpickle the data without any restrictions
return pickle.loads(data)
# Usage example
if __name__ == "__main__":
# Example of loading a potentially unsafe pickle file
with open("data.pkl", "rb") as f:
data = f.read()
obj = load_pickle(data)
print("Loaded object:", obj)Patched code sample
import pickle
# Define a safe unpickler class that restricts what can be unpickled
class SafeUnpickler(pickle.Unpickler):
def find_class(self, module, name):
# Restrict unpickling to only safe classes
if module == "safe_module" and name in ["SafeClass1", "SafeClass2"]:
return super().find_class(module, name)
raise pickle.UnpicklingError("Unauthorized unpickling attempt!")
def safe_load_pickle(data):
return SafeUnpickler(io.BytesIO(data)).load()
# Usage example
if __name__ == "__main__":
# Example of loading a pickle file safely
with open("safe_data.pkl", "rb") as f:
data = f.read()
try:
obj = safe_load_pickle(data)
print("Successfully loaded safe object:", obj)
except pickle.UnpicklingError as e:
print("Failed to unpickle data:", e)Cite this entry
@misc{vaitp:cve20150693,
title = {{Cisco WSA 8.5.0-ise-147: Local users can run Python code via a crafted pickle file}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2015},
note = {VAITP Python Vulnerability Dataset, entry CVE-2015-0693},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2015-0693/}}
}
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 ::
