VAITP Dataset

← Back to the dataset

CVE-2011-4355

GDB < 7.5 privilege escalation via current directory files

  • CVSS 6.9
  • CWE-264
  • Authentication, Authorization, and Session Management
  • Local

GNU Project Debugger (GDB) before 7.5, when .debug_gdb_scripts is defined, automatically loads certain files from the current working directory, which allows local users to gain privileges via crafted files such as Python scripts.

CVSS base score
6.9
Published
2013-03-05
OWASP
A05 Security Misconfiguration
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
GDB
Fixed by upgrading
Yes

Solution

Update GDB to version 7.5 or higher.

Vulnerable code sample

import os
import subprocess

# Function that demonstrates the vulnerability by loading scripts from the current directory
def load_gdb_script(script_name):
    # Directly load the script without any checks
    subprocess.run(["gdb", "-x", script_name])

# Example usage
load_gdb_script(".debug_gdb_scripts")

Patched code sample

import os
import subprocess

# Function to safely load scripts without executing arbitrary code
def safe_load_gdb_script(script_name):
    # Define a safe directory for loading scripts
    safe_directory = "/path/to/safe/directory"
    
    # Ensure the script is within the safe directory
    if os.path.abspath(script_name).startswith(os.path.abspath(safe_directory)):
        subprocess.run(["gdb", "-x", script_name])
    else:
        print("Error: Attempt to load script from an unsafe directory.")

# Example usage
safe_load_gdb_script("example_script.py")

Cite this entry

@misc{vaitp:cve20114355,
  title        = {{GDB < 7.5 privilege escalation via current directory files}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2013},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2011-4355},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2011-4355/}}
}

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.