CVE-2008-5985
Python interface in Epiphany 2.22.3 and other versions allows arbitrary code execution by local users via a malicious Python file
- CVSS 6.9
- CWE-426: Untrusted Search Path
- Input Validation and Sanitization
- Local
Untrusted search path vulnerability in the Python interface in Epiphany 2.22.3, and possibly other versions, allows local users to execute arbitrary code via a Trojan horse Python file in the current working directory, related to a vulnerability in the PySys_SetArgv function (CVE-2008-5983).
- CVSS base score
- 6.9
- Published
- 2009-01-28
- OWASP
- A05 Security Misconfiguration
- 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 Epiphany to version 2.22.4 or higher.
Vulnerable code sample
import os
import sys
# Example of vulnerable code that allows untrusted imports
if __name__ == "__main__":
# Directly using the current working directory in sys.path
sys.path.insert(0, os.getcwd())
# Import a module that could potentially be a Trojan horse
import untrusted_modulePatched code sample
import os
import sys
# Securely set the Python path to avoid untrusted directories
def secure_import(module_name):
# Get the current working directory
cwd = os.getcwd()
# Check if the current working directory is trusted
if cwd not in sys.path:
sys.path.insert(0, cwd)
# Import the module
__import__(module_name)
# Usage example
if __name__ == "__main__":
# Securely import a module
secure_import('trusted_module')Cite this entry
@misc{vaitp:cve20085985,
title = {{Python interface in Epiphany 2.22.3 and other versions allows arbitrary code execution by local users via a malicious Python file}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2009},
note = {VAITP Python Vulnerability Dataset, entry CVE-2008-5985},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2008-5985/}}
}
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 ::
