VAITP Dataset

← Back to the dataset

CVE-2013-1068

Privilege escalation in OpenStack Nova and Cinder via sudo misconfiguration in Ubuntu 13.10 and 14.04 LTS

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

The OpenStack Nova (python-nova) package 1:2013.2.3-0 before 1:2013.2.3-0ubuntu1.2 and 1:2014.1-0 before 1:2014.1-0ubuntu1.2 and Openstack Cinder (python-cinder) package 1:2013.2.3-0 before 1:2013.2.3-0ubuntu1.1 and 1:2014.1-0 before 1:2014.1-0ubuntu1.1 for Ubuntu 13.10 and 14.04 LTS does not properly set the sudo configuration, which makes it easier for attackers to gain privileges by leveraging another vulnerability.

CVSS base score
5.0
Published
2014-06-19
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
sudo
Fixed by upgrading
Yes

Solution

Update OpenStack Nova to version 1:2013.2.3-0ubuntu1.2 or 1:2014.1-0ubuntu1.2, and update OpenStack Cinder to version 1:2013.2.3-0ubuntu1.1 or 1:2014.1-0ubuntu1.1.

Vulnerable code sample

import os
import subprocess

def insecure_sudo_configuration():
    # This function demonstrates an insecure sudo configuration
    sudoers_file = '/etc/sudoers'
    
    # Backup the original sudoers file
    backup_file = '/etc/sudoers.bak'
    subprocess.run(['cp', sudoers_file, backup_file])

    # Improperly set permissions for the sudoers file
    os.chmod(sudoers_file, 0o644)  # Insecure permission

    # Add insecure sudo configuration
    with open(sudoers_file, 'a') as f:
        f.write('\n# Insecure sudoers configuration\n')
        f.write('Defaults    !secure_path\n')  # Disable secure_path
        f.write('Defaults    env_reset\n')
        f.write('Defaults    visiblepw\n')

insecure_sudo_configuration()

Patched code sample

import os
import subprocess

def secure_sudo_configuration():
    # Ensure that the sudoers file is properly configured
    sudoers_file = '/etc/sudoers'
    
    # Backup the original sudoers file
    backup_file = '/etc/sudoers.bak'
    subprocess.run(['cp', sudoers_file, backup_file])

    # Properly set permissions for the sudoers file
    os.chmod(sudoers_file, 0o440)

    # Add a secure sudo configuration
    with open(sudoers_file, 'a') as f:
        f.write('\n# Secure sudoers configuration\n')
        f.write('Defaults    env_reset\n')
        f.write('Defaults    mail_badge\n')
        f.write('Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"\n')
        f.write('Defaults    visiblepw\n')

secure_sudo_configuration()

Cite this entry

@misc{vaitp:cve20131068,
  title        = {{Privilege escalation in OpenStack Nova and Cinder via sudo misconfiguration in Ubuntu 13.10 and 14.04 LTS}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2014},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2013-1068},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2013-1068/}}
}

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.