CVE-2026-38716
InHand routers have a root command injection vulnerability in the export function.
- CVSS 9.8
- CWE-77
- Input Validation and Sanitization
- Remote
InHand Networks IR912 V1.0.0.r20042 and IR915 V1.0.0.r20042 (including earlier versions) were discovered to contain a command injection vulnerability in the Python application export function. This vulnerability allows remote attackers to execute arbitrary commands as root via a crafted input.
- CWE
- CWE-77
- CVSS base score
- 9.8
- Published
- 2026-06-18
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Python
Solution
Upgrade firmware to version V1.0.0.r5172 or later.
Vulnerable code sample
import os
def export_logs(filename):
"""
This function is designed to export system logs into a compressed archive.
The 'filename' parameter is received from a web interface and is intended
to be the name of the output file.
"""
command = 'tar -czf /tmp/export-' + filename + '.tar.gz /var/log/'
os.system(command)Patched code sample
import subprocess
import os
def export_configuration_fixed(user_provided_filename):
"""
Securely exports system configuration to a compressed archive.
This function fixes a command injection vulnerability by not using a shell
and by treating user input as data, not part of a command string.
"""
# 1. Sanitize input to prevent path traversal attacks (e.g., "../../../etc/passwd").
# os.path.basename() ensures we only get the filename component.
safe_filename = os.path.basename(user_provided_filename)
# Further validation to prevent empty or dot-only filenames.
if not safe_filename or safe_filename in ('.', '..'):
raise ValueError("A valid filename is required.")
destination_path = f"/tmp/{safe_filename}"
source_directory = "/etc/inhand/config" # Example source directory
# 2. Construct the command as a list of arguments, not a single string.
# This ensures that user input is treated as a single, literal argument
# to the 'tar' command, rather than being interpreted by the shell.
command_args = [
"/bin/tar",
"-czf",
destination_path,
source_directory
]
try:
# 3. Execute the command without a shell (shell=False is the default and safest).
# The 'check=True' argument will raise an exception if the command fails.
subprocess.run(
command_args,
check=True,
capture_output=True,
text=True
)
print(f"Successfully created archive at {destination_path}")
except FileNotFoundError:
# This error occurs if the '/bin/tar' executable doesn't exist.
print("Error: The 'tar' command could not be found.")
raise
except subprocess.CalledProcessError as e:
# This error occurs if 'tar' returns a non-zero exit code.
print(f"Error executing tar command: {e.stderr}")
raise
except ValueError as e:
# Catches the invalid filename error from our validation.
print(f"Error: {e}")
raisePayload
; /bin/id;
Cite this entry
@misc{vaitp:cve202638716,
title = {{InHand routers have a root command injection vulnerability in the export function.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-38716},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-38716/}}
}
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 ::
