VAITP Dataset

← Back to the dataset

CVE-2008-5987

Untrusted search path vulnerability in Eye of GNOME (eog) 2.22.3 allows local users to execute arbitrary code via a Trojan horse Python file in the current working directory

  • CVSS 6.9
  • CWE-426: Untrusted Search Path
  • Design Defects
  • Local

Untrusted search path vulnerability in the Python interface in Eye of GNOME (eog) 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
A06 Vulnerable and Outdated Components
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Design Defects
Subcategory
Security Misconfigurations
Accessibility scope
Local
Impact
Arbitrary Code Execution
Affected component
Python
Fixed by upgrading
Yes

Solution

Update Eye of GNOME (eog) to version 2.22.4 or higher.

Vulnerable code sample

import sys

# This code simulates the untrusted search path vulnerability
# where a malicious Python file in the current directory can be imported.

# Assume a malicious file named 'malicious.py' exists in the current directory
# and is intended to execute arbitrary code when imported.

# This import could potentially load the malicious file instead of the intended module
module_name = 'malicious'  # The name of the module to import
try:
    imported_module = __import__(module_name)
except ImportError as e:
    print(f"Error importing module: {e}")

Patched code sample

import sys
import os

def safe_import(module_name):
    # Ensure that the module is imported from a trusted location
    if os.path.dirname(module_name) not in sys.path:
        raise ImportError(f"Untrusted import attempt from {module_name}")
    return __import__(module_name)

# Example usage
try:
    my_module = safe_import('my_trusted_module')
except ImportError as e:
    print(e)

Cite this entry

@misc{vaitp:cve20085987,
  title        = {{Untrusted search path vulnerability in Eye of GNOME (eog) 2.22.3 allows local users to execute arbitrary code via a Trojan horse Python file in the current working directory}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2009},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2008-5987},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2008-5987/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.