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 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 pipelin
This issue can be reached with local access to the system, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability none.
The score comes from this vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
CVE-2026-40113 is classified as CWE-88: Argument Injection. Input is passed into a command line without separating data from options, letting an attacker introduce extra arguments.
CVE-2026-40113 is recorded against 1 package.
Published on 10 April 2026 and last revised on 13 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from OSV.
github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)
praisonai has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-88: Argument Injection) in other software:
Details
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| praisonai | — | 4.5.128 |
References
Similar Threats
Exploit Protection
CVE-2026-40113 carries CVSS 8.0 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2026-40113 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.