CVE-2026-40287: Praisonaiagents Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-g985-wjh9-qxxc
CVSS 8.4
CWE-426 CWE-94
Published
Advisory Summary

CVE-2026-40287 is a HIGH (CVSS 8.4) remote code execution vulnerability (CWE-426: Untrusted Search Path) affecting Praisonaiagents libraries in the PyPI ecosystem. The issue involves praisonai vulnerable to rce via automatic tools.py import. Remediation is available by upgrading affected packages to version 1.5.140, 4.5.139.

CVE-2026-40287 at a Glance

CVE Identifier CVE-2026-40287
GHSA Identifier GHSA-g985-wjh9-qxxc
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-426: Untrusted Search Path
Affected Product Praisonaiagents
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:N/UI:N/S:U/C:H/I:H/A:H).

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

How to Fix CVE-2026-40287

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

praisonaiagents fixed: 1.5.140
pip install praisonaiagents>=1.5.140
PraisonAI fixed: 4.5.139
pip install PraisonAI>=4.5.139
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 praisonaiagents

How to Check if You Are Affected

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

pip show praisonaiagents

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-426: Untrusted Search Path, where the product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control. In Praisonaiagents, 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

PraisonAI automatically imports `./tools.py` from the current working directory when launching certain components. This includes call.py, tool_resolver.py, and CLI tool-loading paths. A malicious tools.py placed in the process working directory is executed immediately, allowing arbitrary Python code execution in the host environment. ### Affected Code - call.py → `import_tools_from_file()` - tool_resolver.py → `_load_local_tools()` - tools.py → local tool import flow - ### PoC Create tools.py in the directory where PraisonAI is launched: ```python # tools.py import os os.system("echo pwned > /tmp/pwned.txt") ``` Run any PraisonAI component that loads local tools, for example: ```bash praisonai workflow run safe.yaml ``` ### Reproduction Steps 1. Create a malicious tools.py in the current working directory. 2. Start PraisonAI or invoke a CLI command that loads local tools. 3. Verify that `/tmp/pwned.txt` or the malicious command output exists. ### Impact An attacker who can place or influence tools.py in the working directory can execute arbitrary code in the PraisonAI process, compromising the host and any connected data. **Reporter:** Lakshmikanthan K (letchupkt)

CVE-2026-40287 Affected Praisonaiagents Versions

2 component(s)
Fixed Versions:
1.5.1404.5.139
Product / Package Ecosystem Affected Versions Fixed Version
praisonaiagents
PyPI
< 1.5.140
1.5.140
PraisonAI
PyPI
< 4.5.139
4.5.139

References

Frequently Asked Questions

What is CVE-2026-40287?
CVE-2026-40287 is a security vulnerability in Praisonaiagents involving PraisonAI Vulnerable to RCE via Automatic tools.py Import under CWE-426: Untrusted Search Path.
Which Praisonaiagents versions are affected?
Affected versions include releases prior to 1.5.140, 4.5.139 across affected packages: praisonaiagents, PraisonAI.
What version fixes CVE-2026-40287?
Upgrading to 1.5.140, 4.5.139 (or the latest patched release for your respective branch) resolves the vulnerability.
Is praisonaiagents affected?
Yes, praisonaiagents is affected in releases prior to 1.5.140. Upgrade your dependency to 1.5.140 or later.
Is PraisonAI affected?
Yes, PraisonAI is affected in releases prior to 4.5.139. Upgrade your dependency to 4.5.139 or later.
What is the CVSS score of CVE-2026-40287?
CVE-2026-40287 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-40287?
CVE-2026-40287 is classified under CWE-426: Untrusted Search Path (The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control.).
How can I check PyPI dependencies for CVE-2026-40287?
Run the dependency tree command: 'pip show praisonaiagents'. 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-g985-wjh9-qxxc",
  "modified" : "2026-04-14T21:54:23Z",
  "published" : "2026-04-10T19:32:32Z",
  "aliases" : [ "CVE-2026-40287" ],
  "summary" : "PraisonAI Vulnerable to RCE via Automatic tools.py Import",
  "details" : "PraisonAI automatically imports `./tools.py` from the current working directory when launching certain components. This includes call.py, tool_resolver.py, and CLI tool-loading paths.\n\nA malicious tools.py placed in the process working directory is executed immediately, allowing arbitrary Python code execution in the host environment.\n\n### Affected Code\n- call.py → `import_tools_from_file()`\n- tool_resolver.py → `_load_local_tools()`\n- tools.py → local tool import flow\n- \n\n### PoC\nCreate tools.py in the directory where PraisonAI is launched:\n\n```python\n# tools.py\nimport os\nos.system(\"echo pwned > /tmp/pwned.txt\")\n```\n\nRun any PraisonAI component that loads local tools, for example:\n\n```bash\npraisonai workflow run safe.yaml\n```\n\n### Reproduction Steps\n1. Create a malicious tools.py in the current working directory.\n2. Start PraisonAI or invoke a CLI command that loads local tools.\n3. Verify that `/tmp/pwned.txt` or the malicious command output exists.\n\n### Impact\nAn attacker who can place or influence tools.py in the working directory can execute arbitrary code in the PraisonAI process, compromising the host and any connected data.\n\n**Reporter:** Lakshmikanthan K (letchupkt)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "praisonaiagents"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.140"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.5.139"
    }
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "PraisonAI"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.139"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.5.138"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-g985-wjh9-qxxc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40287"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MervinPraison/PraisonAI"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/releases/tag/v4.5.139"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-426", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-10T19:32:32Z",
    "nvd_published_at" : "2026-04-14T04:17:11Z"
  }
}