CVE-2019-19875
B&R APROL allows root-level access via AprolCluster script (CVE-XXXXX)
- CVSS 9.8
- CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')
- Input Validation and Sanitization
- Local
An issue was discovered in B&R Industrial Automation APROL before R4.2 V7.08. Arbitrary commands could be injected (using Python scripts) via the AprolCluster script that is invoked via sudo and thus executes with root privileges, a different vulnerability than CVE-2019-16364.
- CVSS base score
- 9.8
- Published
- 2020-11-27
- 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
- Python
- Fixed by upgrading
- Yes
Solution
Update B&R Industrial Automation APROL to version R4.2 V7.08 or higher.
Vulnerable code sample
import subprocess
def execute_command(command):
# Directly executing user-provided command without validation
subprocess.run(command, shell=True)
# Example usage
user_input = input("Enter command to execute: ")
execute_command(user_input)Patched code sample
import subprocess
import shlex
def safe_execute(command):
# Validate the command to prevent arbitrary command execution
allowed_commands = ['command1', 'command2', 'command3'] # Define allowed commands
command_parts = shlex.split(command)
if command_parts[0] in allowed_commands:
# Execute the command safely
subprocess.run(command_parts)
else:
raise ValueError("Unauthorized command execution attempt detected.")
# Example usage
try:
user_input = "command1" # This should be sanitized and validated
safe_execute(user_input)
except ValueError as e:
print(e)Cite this entry
@misc{vaitp:cve201919875,
title = {{B&R APROL allows root-level access via AprolCluster script (CVE-XXXXX)}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2020},
note = {VAITP Python Vulnerability Dataset, entry CVE-2019-19875},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2019-19875/}}
}
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 ::
