VAITP Dataset

← Back to the dataset

CVE-2021-36667

Druva inSync 6.9.0 for MacOS: Command injection allows arbitrary command execution

  • CVSS 7.8
  • CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
  • Input Validation and Sanitization
  • Local

Command injection vulnerability in Druva inSync 6.9.0 for MacOS, allows attackers to execute arbitrary commands via crafted payload to the local HTTP server due to un-sanitized call to the python os.system library.

CVSS base score
7.8
Published
2022-07-12
OWASP
A03 Injection
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
os.system
Fixed by upgrading
Yes

Solution

Update Druva inSync to version 7.0.0 or higher.

Vulnerable code sample

import os

def execute_command(command):
    # Unsanitized command execution
    os.system(command)

# Example usage
user_input = input("Enter a command to execute: ")
execute_command(user_input)

Patched code sample

import subprocess

def safe_execute_command(command):
    # Validate and sanitize the command input
    allowed_commands = ['ls', 'pwd', 'whoami']  # Example of allowed commands
    if command in allowed_commands:
        result = subprocess.run(command, shell=True, check=True, text=True, capture_output=True)
        return result.stdout
    else:
        raise ValueError("Unauthorized command")

# Example usage
try:
    output = safe_execute_command('ls')
    print(output)
except ValueError as e:
    print(e)

Cite this entry

@misc{vaitp:cve202136667,
  title        = {{Druva inSync 6.9.0 for MacOS: Command injection allows arbitrary command execution}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2022},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2021-36667},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2021-36667/}}
}

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.