CVE-2026-40113: PraisonAI PraisonAI Vulnerable To Argument Injection Vulnerability

HIGH
Advisory Identifier: GHSA-fvxx-ggmx-3cjg
CVSS 8.4
CWE-88
Published
Advisory Summary

CVE-2026-40113 is a HIGH (CVSS 8.4) praisonai vulnerable to argument injection vulnerability (CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')) affecting PraisonAI libraries in the PyPI ecosystem. The issue involves praisonai vulnerable to argument injection into cloud run environment variables via unsanitized comma in gcloud --set-env-vars. Remediation is available by upgrading affected packages to version 4.5.128.

CVE-2026-40113 at a Glance

CVE Identifier CVE-2026-40113
GHSA Identifier GHSA-fvxx-ggmx-3cjg
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
Affected Product PraisonAI
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-40113

To remediate this vulnerability, upgrade all affected PraisonAI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

PraisonAI fixed: 4.5.128
pip install PraisonAI>=4.5.128
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show PraisonAI

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-40113, inspect your installed packages using pip:

pip show PraisonAI

Analyze the terminal output to locate any version of PraisonAI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.5.128), your application is affected.

Note: The pip show PraisonAI command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection'), where the product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string. In PraisonAI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**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 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

CVE-2026-40113 Affected PraisonAI Versions

1 component(s)
Fixed Versions:
4.5.128
Product / Package Ecosystem Affected Versions Fixed Version
PraisonAI
PyPI
< 4.5.128
4.5.128

References

Frequently Asked Questions

What is CVE-2026-40113?
CVE-2026-40113 is a security vulnerability in PraisonAI involving PraisonAI Vulnerable to Argument Injection into Cloud Run Environment Variables via Unsanitized Comma in gcloud --set-env-vars under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection').
Which PraisonAI versions are affected?
Affected versions include releases prior to 4.5.128 across affected packages: PraisonAI.
What version fixes CVE-2026-40113?
Upgrading to 4.5.128 (or the latest patched release for your respective branch) resolves the vulnerability.
Is PraisonAI affected?
Yes, PraisonAI is affected in releases prior to 4.5.128. Upgrade your dependency to 4.5.128 or later.
What is the CVSS score of CVE-2026-40113?
CVE-2026-40113 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2026-40113?
CVE-2026-40113 is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') (The product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string.).
How can I check PyPI dependencies for CVE-2026-40113?
Run the dependency tree command: 'pip show PraisonAI'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fvxx-ggmx-3cjg",
  "modified" : "2026-04-10T19:22:37Z",
  "published" : "2026-04-10T19:22:37Z",
  "aliases" : [ "CVE-2026-40113" ],
  "summary" : "PraisonAI Vulnerable to Argument Injection into Cloud Run Environment Variables via Unsanitized Comma in gcloud --set-env-vars",
  "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:  '--set-env-vars', f'OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}'\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 '140,165p' \\\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: '--set-env-vars', f'OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}'\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's 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's 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      ['gcloud', 'run', 'deploy', 'praisonai-service',\n       '--set-env-vars',\n       f'OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}']\n\n    After:\n      ['gcloud', 'run', 'deploy', 'praisonai-service',\n       '--update-env-vars', f'OPENAI_MODEL_NAME={openai_model}',\n       '--update-env-vars', f'OPENAI_API_KEY={openai_key}',\n       '--update-env-vars', f'OPENAI_API_BASE={openai_base}']\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",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "PraisonAI"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.128"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-88" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-10T19:22:37Z",
    "nvd_published_at" : "2026-04-09T22:16:34Z"
  }
}