CVE-2012-0860
Untrusted search path in RHEV-M 3.1 allows local users to gain privileges via malicious Python modules in /tmp when adding a host
- CVSS 6.2
- CWE-426: Untrusted Search Path
- Authentication, Authorization, and Session Management
- Local
Multiple untrusted search path vulnerabilities in Red Hat Enterprise Virtualization Manager (RHEV-M) before 3.1, when adding a host, allow local users to gain privileges via a Trojan horse (1) deployUtil.py or (2) vds_bootstrap.py Python module in /tmp/.
- CVSS base score
- 6.2
- Published
- 2013-01-04
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Privilege Escalation
- Accessibility scope
- Local
- Impact
- Privilege Escalation
- Affected component
- Python
- Fixed by upgrading
- Yes
Solution
Update Red Hat Enterprise Virtualization Manager (RHEV-M) to version 3.1 or higher.
Vulnerable code sample
import os
# Vulnerable code that loads modules from an untrusted directory
def load_module(module_name):
# This allows loading from the current working directory or /tmp
module_path = os.path.join('/tmp', module_name)
if os.path.isfile(module_path):
exec(open(module_path).read(), globals())
else:
raise ImportError(f"Module {module_name} not found in /tmp.")
# Example usage
if __name__ == "__main__":
try:
load_module('deployUtil.py')
load_module('vds_bootstrap.py')
except ImportError as e:
print(e)Patched code sample
import os
import sys
# Securely define the path to the Python modules
MODULES_DIR = '/usr/local/lib/my_secure_modules'
def load_module(module_name):
# Ensure the module is loaded from a trusted directory
module_path = os.path.join(MODULES_DIR, module_name)
if os.path.isfile(module_path):
exec(open(module_path).read(), globals())
else:
raise ImportError(f"Module {module_name} not found in secure directory.")
# Example usage
if __name__ == "__main__":
try:
load_module('deployUtil.py')
load_module('vds_bootstrap.py')
except ImportError as e:
print(e)
sys.exit(Cite this entry
@misc{vaitp:cve20120860,
title = {{Untrusted search path in RHEV-M 3.1 allows local users to gain privileges via malicious Python modules in /tmp when adding a host}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2013},
note = {VAITP Python Vulnerability Dataset, entry CVE-2012-0860},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2012-0860/}}
}
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 ::
