Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-40113 — praisonai

🟠 CVSS 8.0 — High ⚠️ Exploit Public CWE-88 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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

How this vulnerability can be exploited

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.

CVSS metrics in full

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

  • Attack vector: Local — a local account, shell or session on the host is needed.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

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.

Affected software

CVE-2026-40113 is recorded against 1 package.

  • praisonai (fixed in 4.5.128)

Timeline and source

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.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)

Other advisories for this package

praisonai has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-88: Argument Injection) in other software:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
CWE CWE-88
Public Exploit ⚠️ Yes
Source OSV
Published 2026-04-10
Updated 2026-08-20
Modified 2026-07-13
Fix URL N/A

Affected Packages

Software From version Fixed in
praisonai 4.5.128

Similar Threats

Exploit Protection

Are you running praisonai?

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.

Browse related advisories

All advisoriesCVECVE 2026