CVE-2024-27173
Remote Command program enables attackers to achieve Remote Code Execution.
- CVSS 9.8
- CWE-22
- Input Validation and Sanitization
- Remote
Remote Command program allows an attacker to get Remote Code Execution by overwriting existing Python files containing executable code. This vulnerability can be executed in combination with other vulnerabilities and difficult to execute alone. So, the CVSS score for this vulnerability alone is lower than the score listed in the "Base Score" of this vulnerability. For detail on related other vulnerabilities, please ask to the below contact point. https://www.toshibatec.com/contacts/products/ As for the affected products/models/versions, see the reference URL.
- CWE
- CWE-22
- CVSS base score
- 9.8
- Published
- 2024-06-14
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Algorithm
- Code defect classification
- **Incorrect Algorithm**
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Python
Solution
Upgrade to the latest version of the Remote Command program as specified by Toshiba Tec for security patches.
Vulnerable code sample
def file_write(file_path, content):
with open(file_path, 'w') as file:
file.write(content)
file_write('/path/to/executable.py', 'print("Code execution")')Patched code sample
import os
def file_write(file_path, content):
if not os.path.abspath(file_path).startswith(os.path.abspath('/directory/')):
raise ValueError("Unsafe file path!")
with open(file_path, 'w') as file:
file.write(content)
try:
file_write('/path/to/executable.py', 'print("Code execution")')
except ValueError as e:
print(e)Payload
import os
# Example payload to overwrite an existing Python file
payload = 'import os\nos.system("echo Malicious code > /path/to/existing_file.py")'
# Simulating the execution of the payload
exec(payload)
Cite this entry
@misc{vaitp:cve202427173,
title = {{Remote Command program enables attackers to achieve Remote Code Execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2024},
note = {VAITP Python Vulnerability Dataset, entry CVE-2024-27173},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-27173/}}
}
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 ::
