VAITP Dataset

← Back to the dataset

CVE-2015-4231

Cisco NX-OS 6.2(8a) allows an admin in one VDC to delete files in another VDC

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

The Python interpreter in Cisco NX-OS 6.2(8a) on Nexus 7000 devices allows local users to bypass intended access restrictions and delete an arbitrary VDC's files by leveraging administrative privileges in one VDC, aka Bug ID CSCur08416.

CVSS base score
3.6
Published
2015-07-03
OWASP
A01 Broken Access Control
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Authentication, Authorization, and Session Management
Subcategory
Privilege Escalation
Accessibility scope
Local
Impact
Unauthorized Access
Affected component
Python
Fixed by upgrading
Yes

Solution

Update Cisco NX-OS to version 6.2(8b) or higher.

Vulnerable code sample

class VDC:
    def __init__(self, name):
        self.name = name
        self.files = {}

    def create_file(self, filename, content):
        self.files[filename] = content

    def delete_file(self, filename, user_role):
        # Vulnerability: No proper access control checks
        if filename in self.files:
            del self.files[filename]  # Allows any user to delete files regardless of role
        else:
            raise FileNotFoundError("File not found.")

# Example of usage
vdc1 = VDC("VDC1")
vdc1.create_file("important_file.txt", "This is important content.")

# Non-admin user deleting the file
try:
    vdc1.delete_file("important_file.txt", user_role='user')  # Should succeed due to lack of checks
    print("File deleted successfully.")
except Exception as e:
    print(e)

Patched code sample

class VDC:
    def __init__(self, name):
        self.name = name
        self.files = {}

    def create_file(self, filename, content):
        self.files[filename] = content

    def delete_file(self, filename, user_role):
        if user_role != 'admin':
            raise PermissionError("Access denied: You do not have permission to delete files in this VDC.")
        if filename in self.files:
            del self.files[filename]
        else:
            raise FileNotFoundError("File not found.")

# Example of usage
vdc1 = VDC("VDC1")
vdc1.create_file("important_file.txt", "This is important content.")

# Attempting to delete a file with non-admin role
try:
    vdc1.delete_file("important_file.txt", user_role='user')  # Should raise PermissionError
except PermissionError as e:
    print(e)

# Admin user deleting the file
try:
    vdc1.delete_file("important_file.txt", user_role='admin')  # Should succeed
    print("File deleted successfully.")
except Exception as e:
    print(e)

Cite this entry

@misc{vaitp:cve20154231,
  title        = {{Cisco NX-OS 6.2(8a) allows an admin in one VDC to delete files in another VDC}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2015},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2015-4231},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2015-4231/}}
}

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.