CVE-2011-2520
Pickle module in system-config-firewall allows local privilege escalation via D-Bus
- CVSS 7.8
- CWE-502
- Input Validation and Sanitization
- Local
fw_dbus.py in system-config-firewall 1.2.29 and earlier uses the pickle Python module unsafely during D-Bus communication between the GUI and the backend, which might allow local users to gain privileges via a crafted serialized object.
- CWE
- CWE-502
- CVSS base score
- 7.8
- Published
- 2011-07-21
- 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
- Local
- Impact
- Privilege Escalation
- Affected component
- Python
- Fixed by upgrading
- Yes
Solution
Update system-config-firewall to version 1.2.30 or higher.
Vulnerable code sample
import dbus
import pickle
class FirewallConfig:
def __init__(self):
# Initialize firewall configuration
pass
def set_config(self, serialized_data):
# Unsafe use of pickle for deserialization
try:
config = pickle.loads(serialized_data)
# Process the config
except Exception as e:
print(f"Error processing configuration: {e}")
# Example of how to expose the method via D-Bus
def main():
bus = dbus.SystemBus()
obj = FirewallConfig()
bus.export('/com/example/FirewallConfig', obj)
if __name__ == "__main__":
main()Patched code sample
import json
import dbus
class FirewallConfig:
def __init__(self):
# Initialize firewall configuration
pass
def set_config(self, config_data):
# Use json instead of pickle for safe deserialization
try:
config = json.loads(config_data)
# Process the config safely
except json.JSONDecodeError as e:
print(f"Invalid configuration data: {e}")
# Example of how to expose the method via D-Bus
def main():
bus = dbus.SystemBus()
obj = FirewallConfig()
bus.export('/com/example/FirewallConfig', obj)
if __name__ == "__main__":
main()Cite this entry
@misc{vaitp:cve20112520,
title = {{Pickle module in system-config-firewall allows local privilege escalation via D-Bus}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2011},
note = {VAITP Python Vulnerability Dataset, entry CVE-2011-2520},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2011-2520/}}
}
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 ::
