VAITP Dataset

← Back to the dataset

CVE-2014-6448

Local users can execute Python code via shell access in vulnerable Junos OS versions before specified releases

  • CVSS 7.8
  • CWE-269 Improper Privilege Management
  • Input Validation and Sanitization
  • Local

Juniper Junos OS 13.2 before 13.2R5, 13.2X51, 13.2X52, and 13.3 before 13.3R3 allow local users to bypass intended restrictions and execute arbitrary Python code via vectors involving shell access.

CVSS base score
7.8
Published
2020-01-15
OWASP
A05 Security Misconfiguration
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Local
Impact
Arbitrary Code Execution
Affected component
Juniper Junos OS
Fixed by upgrading
Yes

Solution

Update Junos OS to version 13.2R5, 13.2X51, 13.2X52, or 13.3R3 or higher.

Vulnerable code sample

import subprocess

# Vulnerable function that allows arbitrary command execution
def execute_command(command):
    # No restrictions on the command input
    result = subprocess.run(command, shell=True, check=True, capture_output=True, text=True)
    return result.stdout

# Example usage
try:
    output = execute_command('ls')  # Arbitrary command
    print(output)
    
    output = execute_command('rm -rf /')  # Dangerous command, could be executed
    print(output)
except Exception as e:
    print(e)

Patched code sample

import subprocess

# Fixed function to execute a command securely
def secure_execute(command):
    # Only allow specific commands to be executed
    allowed_commands = ['ls', 'whoami', 'pwd']
    
    if command in allowed_commands:
        result = subprocess.run(command, shell=True, check=True, capture_output=True, text=True)
        return result.stdout
    else:
        raise PermissionError("This command is not allowed.")

# Example usage
try:
    output = secure_execute('ls')  # Allowed command
    print(output)
    
    output = secure_execute('rm -rf /')  # Not allowed command, will raise an error
    print(output)
except PermissionError as e:
    print(e)

Cite this entry

@misc{vaitp:cve20146448,
  title        = {{Local users can execute Python code via shell access in vulnerable Junos OS versions before specified releases}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2020},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2014-6448},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2014-6448/}}
}

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.