CVE-2008-4394
Untrusted search path vuln in Portage < 2.1.4.5 lets local users run code via manipulated Python modules in certain ebuilds
- CVSS 6.9
- CWE-427: Uncontrolled Search Path Element
- Input Validation and Sanitization
- Local
Multiple untrusted search path vulnerabilities in Portage before 2.1.4.5 include the current working directory in the Python search path, which allows local users to execute arbitrary code via a modified Python module that is loaded by the (1) ys-apps/portage, (2) net-mail/fetchmail, (3) app-editors/leo ebuilds, and other ebuilds.
- CVSS base score
- 6.9
- Published
- 2008-10-10
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Direct Object References (IDOR)
- Accessibility scope
- Local
- Impact
- Arbitrary Code Execution
- Affected component
- Python
- Fixed by upgrading
- Yes
Solution
Update Portage to version 2.1.4.5 or higher.
Vulnerable code sample
import sys
# Current working directory is included in the Python search path
# This allows for potential execution of arbitrary code from untrusted modules
print("Current Python path:", sys.path)
# Proceed with loading a module
# For demonstration, let's assume we're trying to import a custom module
import custom_module # This could be a malicious module in the current directory
# Continue with the application logic
# ...Patched code sample
import sys
import os
# Ensure the current working directory is not included in the Python search path
if os.getcwd() in sys.path:
sys.path.remove(os.getcwd())
# Proceed with the rest of the application logic
# ...Cite this entry
@misc{vaitp:cve20084394,
title = {{Untrusted search path vuln in Portage < 2.1.4.5 lets local users run code via manipulated Python modules in certain ebuilds}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2008},
note = {VAITP Python Vulnerability Dataset, entry CVE-2008-4394},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2008-4394/}}
}
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 ::
