/

CVE-2026-45369

Severity:

HIGH RISK

(8.3)

OS Command Injection in python-utcp

CVE-2026-45369

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution via Shell Command Injection

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

python-utcp's CLI communication layer constructs shell commands by inserting user-controlled arguments directly into command strings and executing them via /bin/bash -c on Unix and powershell.exe -Command on Windows.

When an attacker can influence tool_args, they may inject arbitrary shell commands that run with the privileges of the python-utcp process.

Affected context

The vulnerability occurs in environments where python-utcp is used to invoke tools or commands through its CLI communication protocol.

Specifically, the _substitute_utcp_args method in cli_communication_protocol.py directly interpolates user-controlled tool_args into shell command strings.

When these composed strings are executed via a system shell (/bin/bash -c or powershell.exe -Command), any lack of argument sanitization or escaping enables command injection if an attacker can supply or modify the arguments.

Exploit preconditions

  • Attack surface: Interfaces or workflows that pass user or external input into python-utcp tool_args (e.g., APIs, CLI wrappers, automation scripts).
  • Required access: Ability to influence or control the values passed into tool_args (direct user input, supplied configuration, or compromised upstream system).
  • Trigger point: Execution of the vulnerable code path in _substitute_utcp_args, which builds a shell command string and runs it using /bin/bash -c (Unix) or powershell.exe -Command (Windows).
  • Why exploitation is possible: Untrusted input is concatenated into a shell command without escaping or validation, allowing special shell metacharacters, operators, or command separators to alter the intended command and execute attacker-chosen commands.

Why this happens

This issue is a classic case of OS Command Injection (CWE-78).

The _substitute_utcp_args method treats user-controlled tool_args as trusted and directly interpolates them into shell command strings.

Instead of passing arguments as separate, safely-encoded parameters to a process execution API, the code relies on a shell to interpret a constructed command line, thereby granting the attacker control over how the shell parses and executes the command.

The insecure pattern is:

  • Building a string that represents a complete shell command with embedded untrusted data.
  • Executing it through a shell interpreter (/bin/bash -c or powershell.exe -Command) without sanitization, escaping, or strict whitelisting.

This combination allows input that includes shell syntax (e.g., separators, redirections, or nested commands) to change the behavior from a simple tool invocation to arbitrary command execution.

Potential impact

  • Execution of arbitrary system commands with the privileges of the python-utcp process.
  • Reading, modifying, or deleting data accessible to the affected service or user account.
  • Installing backdoors, malware, or persistence mechanisms on the host.
  • Pivoting to other internal systems or services reachable from the compromised host.
  • Exfiltration of sensitive configuration, credentials, or secrets available in the environment.
  • Disruption of services, including denial-of-service by running resource-intensive or destructive commands.

General mitigation guidance

Effective mitigation focuses on removing the need for a shell and strictly controlling how commands are executed:

  • Prefer process execution APIs that accept an argument vector (e.g., exec-style or subprocess calls without shell=True), so arguments are not interpreted by a shell.
  • Treat any external or user-supplied data passed into command execution as untrusted, and avoid concatenating it into command strings.
  • Where dynamic arguments are unavoidable, constrain them via strict allowlists (e.g., enumerated flags, numeric ranges, or fixed options) rather than free-form strings.
  • Introduce validation layers that reject input containing shell metacharacters, control operators, or unexpected whitespace patterns.
  • Apply least-privilege principles to the python-utcp process: run it under a minimally privileged account and restrict its access to the filesystem, network, and sensitive resources.
  • Prefer structured communication protocols (e.g., APIs or RPC calls) for tool coordination instead of launching shell commands when feasible.

How teams detect issues like this

Detection generally combines code-level analysis with runtime monitoring:

  • Static analysis: Configure SAST rules to flag use of shell-based execution APIs with string interpolation or concatenation, especially around /bin/bash -c, powershell.exe -Command, and any shell=True-style patterns.
  • Code review signals: During manual review, look for:
  • Command strings built with f-strings, format calls, or concatenation that include user-controllable variables (like tool_args).
  • Any invocation path that converts structured input into a single shell command line.
  • Policy enforcement: Establish coding guidelines that discourage or prohibit shell-based command construction, enforcing safe wrappers for process execution and requiring justification for any shell usage.
  • Runtime monitoring: Use logging and security monitoring to detect anomalous command invocations, unusual use of shell operators, or unexpected tools being executed by python-utcp.
  • Automated tooling: Integrate automated code scanning tools into CI pipelines to surface potential command injection vectors before deployment.

Sources

SourceLink
github.comgithub.com/universal-tool-calling-protocol/python-utcp/security/advisories/GHSA-33p6-5jxp-p3x4

Frequently asked

questions

It can be, depending on how python-utcp is integrated. If remote users or external systems can influence the tool_args passed into python-utcp, then an attacker may trigger command injection from a remote context. In purely local setups where only trusted operators control the arguments, practical exploitation is less likely.

The attacker needs a way to control or significantly influence the tool_args values that reach _substitute_utcp_args. This could be through a network API, a user-facing CLI, automation scripts, or any upstream component that passes user input into python-utcp.

Avoid building shell command strings with untrusted data and do not rely on the shell to parse arguments. Use process execution APIs that accept argument lists, strictly validate any dynamic parameters, and restrict them to known-safe values whenever possible.

Adopt a secure coding standard that treats all external inputs as untrusted, forbids ad hoc shell command construction, and mandates safe wrappers for command execution. Combine this with automated static analysis, security-focused code review checklists, and least-privilege deployment practices to catch command injection patterns early in development.

Find out what's already
exploitable in your codebase.