GHSA-FVXX-GGMX-3CJG
Vulnerability from github – Published: 2026-04-10 19:22 – Updated: 2026-04-10 19:22Summary
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 Evidence
Step 1. Confirm the vulnerable string construction at line 150
grep -n "set-env-vars\|openai_key\|openai_base\|openai_model" \
src/praisonai/praisonai/deploy.py
Expected output showing unsanitized interpolation:
150: '--set-env-vars', f'OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}'
Step 2. Confirm no comma validation exists before this line
grep -n "comma\|assertNotIn\|ValueError\|sanitize\|strip\|replace" \
src/praisonai/praisonai/deploy.py
Expected output: no results related to input validation
Step 3. View the full context of the vulnerable construction
sed -n '140,165p' \
src/praisonai/praisonai/deploy.py
This block shows the gcloud command list where the three values are
joined into one comma-separated string passed as a single argument
element. gcloud receives this string and applies its own
comma-based parsing, which the subprocess list form cannot prevent.
Step 4. Confirm subprocess is called without shell=True
grep -n "subprocess\|Popen\|shell=" \
src/praisonai/praisonai/deploy.py
This confirms shell=False (default), meaning the injection is at the
gcloud argument level, not the shell level. The comma delimiter is
parsed by gcloud itself, not by /bin/sh.
Step 5. Confirm no existing advisory covers this file
grep -rn "deploy.py\|set.env.vars\|openai_base" \
src/praisonai/praisonai/deploy.py
Vulnerability Description
File:
src/praisonai/praisonai/deploy.py
Vulnerable line:
150: '--set-env-vars', f'OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}'
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 Concept
attacker-controlled openai_base value:
export OPENAI_API_KEY="sk-legitimate-key"
export OPENAI_MODEL_NAME="gpt-4"
export OPENAI_API_BASE="https://api.openai.com/v1,INJECTED=attacker_value"
Run the deploy command. The string constructed at line 150 becomes:
OPENAI_MODEL_NAME=gpt-4,OPENAI_API_KEY=sk-legitimate-key,OPENAI_API_BASE=https://api.openai.com/v1,INJECTED=attacker_value
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:
gcloud run services describe praisonai-service \
--region us-central1 \
--format "value(spec.template.spec.containers[0].env)"
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:
Before:
['gcloud', 'run', 'deploy', 'praisonai-service',
'--set-env-vars',
f'OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}']
After:
['gcloud', 'run', 'deploy', 'praisonai-service',
'--update-env-vars', f'OPENAI_MODEL_NAME={openai_model}',
'--update-env-vars', f'OPENAI_API_KEY={openai_key}',
'--update-env-vars', f'OPENAI_API_BASE={openai_base}']
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:
for label, value in [
("OPENAI_MODEL_NAME", openai_model),
("OPENAI_API_KEY", openai_key),
("OPENAI_API_BASE", openai_base),
]:
if "," in value:
raise ValueError(
f"{label} contains a comma and would corrupt "
f"--set-env-vars: {value!r}"
)
References
CWE-88 Improper Neutralization of Argument Delimiters in a Command gcloud run deploy documentation for --set-env-vars KEY=VALUE comma delimiter specification
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "PraisonAI"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.5.128"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-40113"
],
"database_specific": {
"cwe_ids": [
"CWE-88"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-10T19:22:37Z",
"nvd_published_at": "2026-04-09T22:16:34Z",
"severity": "HIGH"
},
"details": "**Summary**\n\ndeploy.py constructs a single comma-delimited string for the gcloud run\ndeploy --set-env-vars argument by directly interpolating openai_model,\nopenai_key, and openai_base without validating that these values do not\ncontain commas. gcloud uses a comma as the key-value pair separator for\n--set-env-vars. A comma in any of the three values causes gcloud to\nparse the trailing text as additional KEY=VALUE definitions, injecting\narbitrary environment variables into the deployed Cloud Run service.\n\n\nGrep Commands and Evidence\n\nStep 1. Confirm the vulnerable string construction at line 150\n```\n grep -n \"set-env-vars\\|openai_key\\|openai_base\\|openai_model\" \\\n src/praisonai/praisonai/deploy.py\n```\n Expected output showing unsanitized interpolation:\n 150: \u0027--set-env-vars\u0027, f\u0027OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}\u0027\n\nStep 2. Confirm no comma validation exists before this line\n```\n grep -n \"comma\\|assertNotIn\\|ValueError\\|sanitize\\|strip\\|replace\" \\\n src/praisonai/praisonai/deploy.py\n```\n Expected output: no results related to input validation\n\nStep 3. View the full context of the vulnerable construction\n```\n sed -n \u0027140,165p\u0027 \\\n src/praisonai/praisonai/deploy.py\n```\n This block shows the gcloud command list where the three values are\n joined into one comma-separated string passed as a single argument\n element. gcloud receives this string and applies its own\n comma-based parsing, which the subprocess list form cannot prevent.\n\nStep 4. Confirm subprocess is called without shell=True\n```\n grep -n \"subprocess\\|Popen\\|shell=\" \\\n src/praisonai/praisonai/deploy.py\n```\n This confirms shell=False (default), meaning the injection is at the\n gcloud argument level, not the shell level. The comma delimiter is\n parsed by gcloud itself, not by /bin/sh.\n\nStep 5. Confirm no existing advisory covers this file\n```\n grep -rn \"deploy.py\\|set.env.vars\\|openai_base\" \\\n src/praisonai/praisonai/deploy.py\n```\n\nVulnerability Description\n\nFile:\n `src/praisonai/praisonai/deploy.py`\n\nVulnerable line:\n```\n 150: \u0027--set-env-vars\u0027, f\u0027OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}\u0027\n```\n\nThe three values openai_model, openai_key, and openai_base originate\nfrom environment variables or user-provided configuration and are\ninterpolated directly into a single f-string without validation.\n\nThe subprocess call uses a Python list without shell=True. This means\nthere is no shell injection. The subprocess module passes the f-string\nas one complete argument to gcloud. gcloud then applies its own internal\nparsing to the value of --set-env-vars using a comma as the delimiter.\nThis parsing is entirely outside Python\u0027s control.\n\nIf any of the three values contains a comma, gcloud splits on that comma\nand creates an additional KEY=VALUE environment variable from the text\nfollowing it. There is no error or warning from gcloud when this occurs.\n\nThe three values are attacker-controllable in any scenario where\nenvironment variables can be set before the deploy command runs. This\nincludes compromised dotenv files, poisoned CI pipeline secrets, and\nlocal developer machines where an attacker has shell access.\n\n\nProof of Concept\n```\n attacker-controlled openai_base value:\n\n export OPENAI_API_KEY=\"sk-legitimate-key\"\n export OPENAI_MODEL_NAME=\"gpt-4\"\n export OPENAI_API_BASE=\"https://api.openai.com/v1,INJECTED=attacker_value\"\n```\n\nRun the deploy command. The string constructed at line 150 becomes:\n```\n OPENAI_MODEL_NAME=gpt-4,OPENAI_API_KEY=sk-legitimate-key,OPENAI_API_BASE=https://api.openai.com/v1,INJECTED=attacker_value\n```\ngcloud parses this as four key-value pairs and creates all four as\nenvironment variables in the Cloud Run service. INJECTED=attacker_value\nis a real environment variable available to every request the service\nhandles.\n\nVerify the injection after deployment:\n```\n gcloud run services describe praisonai-service \\\n --region us-central1 \\\n --format \"value(spec.template.spec.containers[0].env)\"\n```\nThe output includes INJECTED alongside the three legitimate variables.\n\nAPI key override:\n\n ` export OPENAI_API_KEY=\"sk-real,OPENAI_API_KEY=sk-attacker\"`\n\nThe constructed string contains OPENAI_API_KEY twice. In gcloud versions\nwhere the last-defined value takes precedence, the deployed service uses\nsk-attacker for all LLM API calls. All agent traffic routes through the\nattacker-controlled API account.\n\n\n**Impact**\n\nAn attacker who can influence any of the three environment variables\nbefore deploy.py runs can inject arbitrary environment variables into\nthe deployed Cloud Run production service without triggering any error.\n\nInjection scenarios include a malicious git hook that modifies a dotenv\nfile before deployment, a compromised CI pipeline secret, or any local\naccess that allows setting environment variables in the deploy shell\nsession.\n\nConsequences include overriding the API key used by the production\nservice, injecting proxy settings that redirect all outbound LLM traffic,\nsetting debug or verbose flags that write sensitive data to Cloud Run\nlogs, and overriding any security-relevant variable the service reads\nfrom its environment.\n\nThe API key override scenario is the highest-impact case. All production\nLLM calls made by the deployed service are billed to and logged by the\nattacker\u0027s API account, giving the attacker full visibility into every\nagent prompt and response processed in production.\n\n\n**Recommended Fix**\n\nPass each variable as a separate --update-env-vars flag so each value\nis an isolated argument and gcloud never performs comma-based parsing\nacross multiple values:\n\n Before:\n [\u0027gcloud\u0027, \u0027run\u0027, \u0027deploy\u0027, \u0027praisonai-service\u0027,\n \u0027--set-env-vars\u0027,\n f\u0027OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}\u0027]\n\n After:\n [\u0027gcloud\u0027, \u0027run\u0027, \u0027deploy\u0027, \u0027praisonai-service\u0027,\n \u0027--update-env-vars\u0027, f\u0027OPENAI_MODEL_NAME={openai_model}\u0027,\n \u0027--update-env-vars\u0027, f\u0027OPENAI_API_KEY={openai_key}\u0027,\n \u0027--update-env-vars\u0027, f\u0027OPENAI_API_BASE={openai_base}\u0027]\n\nEach --update-env-vars element is a separate string in the subprocess\nlist. The subprocess module passes each as a distinct argument to\ngcloud. gcloud receives three separate single-variable assignments and\nperforms no cross-argument comma parsing.\n\nAdd pre-flight validation as a secondary control:\n\n for label, value in [\n (\"OPENAI_MODEL_NAME\", openai_model),\n (\"OPENAI_API_KEY\", openai_key),\n (\"OPENAI_API_BASE\", openai_base),\n ]:\n if \",\" in value:\n raise ValueError(\n f\"{label} contains a comma and would corrupt \"\n f\"--set-env-vars: {value!r}\"\n )\n\n\nReferences\n\nCWE-88 Improper Neutralization of Argument Delimiters in a Command\ngcloud run deploy documentation for --set-env-vars KEY=VALUE comma\ndelimiter specification",
"id": "GHSA-fvxx-ggmx-3cjg",
"modified": "2026-04-10T19:22:37Z",
"published": "2026-04-10T19:22:37Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-fvxx-ggmx-3cjg"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40113"
},
{
"type": "PACKAGE",
"url": "https://github.com/MervinPraison/PraisonAI"
},
{
"type": "WEB",
"url": "https://github.com/MervinPraison/PraisonAI/releases/tag/v4.5.128"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "PraisonAI Vulnerable to Argument Injection into Cloud Run Environment Variables via Unsanitized Comma in gcloud --set-env-vars"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.