GHSA-fvxx-ggmx-3cjg: PraisonAI Vulnerable to Argument Injection into Cloud Run Environment Variables via Unsanitized Comma in gcloud --set-env-vars
**Summary**deploy.py constructs a single comma-delimited string for the gcloud run
deploy --set-env-vars argument by directly interpolating openai_model,
openai_key, and openai_base without validating that these values do not
contain commas. gcloud uses a comma as the key-value pair separator for
--set-env-vars. A comma in any of the three values causes gcloud to
parse the trailing text as additional KEY=VALUE definitions, injecting
arbitrary environment variables into the deployed Cloud Run service.Grep Commands and EvidenceStep 1. Confirm the vulnerable string construction at line 150Step 2. Confirm no comma validation exists before this lineStep 3. View the full context of the vulnerable constructionStep 4. Confirm subprocess is called without shell=TrueStep 5. Confirm no existing advisory covers this fileVulnerability DescriptionFile:
  `src/praisonai/praisonai/deploy.py`Vulnerable line:The three values openai_model, openai_key, and openai_base originate
from environment variables or user-provided configuration and are
interpolated directly into a single f-string without validation.The subprocess call uses a Python list without shell=True. This means
there is no shell injection. The subprocess module passes the f-string
as one complete argument to gcloud. gcloud then applies its own internal
parsing to the value of --set-env-vars using a comma as the delimiter.
This parsing is entirely outside Python's control.If any of the three values contains a comma, gcloud splits on that comma
and creates an additional KEY=VALUE environment variable from the text
following it. There is no error or warning from gcloud when this occurs.The three values are attacker-controllable in any scenario where
environment variables can be set before the deploy command runs. This
includes compromised dotenv files, poisoned CI pipeline secrets, and
local developer machines where an attacker has shell access.Proof of ConceptRun the deploy command. The string constructed at line 150 becomes:gcloud parses this as four key-value pairs and creates all four as
environment variables in the Cloud Run service. INJECTED=attacker_value
is a real environment variable available to every request the service
handles.Verify the injection after deployment:The output includes INJECTED alongside the three legitimate variables.API key override:`  export OPENAI_API_KEY="sk-real,OPENAI_API_KEY=sk-attacker"`The constructed string contains OPENAI_API_KEY twice. In gcloud versions
where the last-defined value takes precedence, the deployed service uses
sk-attacker for all LLM API calls. All agent traffic routes through the
attacker-controlled API account.**Impact**An attacker who can influence any of the three environment variables
before deploy.py runs can inject arbitrary environment variables into
the deployed Cloud Run production service without triggering any error.Injection scenarios include a malicious git hook that modifies a dotenv
file before deployment, a compromised CI pipeline secret, or any local
access that allows setting environment variables in the deploy shell
session.Consequences include overriding the API key used by the production
service, injecting proxy settings that redirect all outbound LLM traffic,
setting debug or verbose flags that write sensitive data to Cloud Run
logs, and overriding any security-relevant variable the service reads
from its environment.The API key override scenario is the highest-impact case. All production
LLM calls made by the deployed service are billed to and logged by the
attacker's API account, giving the attacker full visibility into every
agent prompt and response processed in production.**Recommended Fix**Pass each variable as a separate --update-env-vars flag so each value
is an isolated argument and gcloud never performs comma-based parsing
across multiple values:Each --update-env-vars element is a separate string in the subprocess
list. The subprocess module passes each as a distinct argument to
gcloud. gcloud receives three separate single-variable assignments and
performs no cross-argument comma parsing.Add pre-flight validation as a secondary control:ReferencesCWE-88 Improper Neutralization of Argument Delimiters in a Command
gcloud run deploy documentation for --set-env-vars KEY=VALUE comma
delimiter specification
CVSS v3.1: 8.4