CVE-2026-40287: PraisonAI has RCE via Automatic tools.py Import

Published Apr 10, 2026
·
Updated

PraisonAI automatically imports ./tools.py from the current working directory when launching certain components. This includes call.py, toolresolver.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 → importtoolsfromfile() - toolresolver.py → loadlocaltools() - 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)

Other sources

PraisonAI is a multi-agent teams system. Versions 4.5.138 and below are vulnerable to arbitrary code execution through automatic, unsanitized import of a tools.py file from the current working directory. Components including call.py (importtoolsfromfile()), toolresolver.py (loadlocaltools()), and CLI tool-loading paths blindly import ./tools.py at startup without any validation, sandboxing, or user confirmation. An attacker who can place a malicious tools.py in the directory where PraisonAI is launched (such as through a shared project, cloned repository, or writable workspace) achieves immediate arbitrary Python code execution in the host environment. This compromises the full PraisonAI process, the host system, and any connected data or credentials. This issue has been fixed in version 4.5.139.

NVD

Affected Software

5 affected componentsFixes available
PraisonAI praisonai<=4.5.138
pip/PraisonAI<=4.5.138
4.5.139
pip/praisonaiagents<=1.5.139
1.5.140
Praison PraisonAI<4.5.139
Praison Praisonaiagents Python<1.5.140

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/PraisonAI to a version that resolves this vulnerability.

    Fixed in 4.5.139
  2. Upgrade

    Upgrade pip/praisonaiagents to a version that resolves this vulnerability.

    Fixed in 1.5.140
  3. Upgrade

    Upgrade PraisonAI to a version that resolves this vulnerability.

    Fixed in 4.5.139
  4. Compensating control

    Prevent untrusted users or processes from writing a tools.py file into the current working directory or the directory where PraisonAI is launched (e.g., ensure the launch/workspace directory is not writable by attackers).

  5. Operational

    After upgrading, verify the expected behavior and check for indicators of compromise such as whether /tmp/pwned.txt (or malicious command output) was created by the exploit.

Event History

Apr 10, 2026
Advisory Published
via GitHub·07:32 PM
Data Sourced
via GitHub·07:32 PM
DescriptionSeverityWeaknessAffected Software
Apr 14, 2026
CVE Published
via MITRE·02:55 AM
Data Sourced
via MITRE·02:55 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:17 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-40287?

CVE-2026-40287 is classified as a high-severity vulnerability due to its potential for arbitrary code execution.

2

How do I fix CVE-2026-40287?

To mitigate CVE-2026-40287, upgrade to PraisonAI version 4.5.139 or later, which addresses the issue.

3

What types of software are affected by CVE-2026-40287?

CVE-2026-40287 affects PraisonAI versions 4.5.138 and earlier.

4

What does CVE-2026-40287 exploit?

CVE-2026-40287 exploits the unsanitized import of a tools.py file leading to possible arbitrary code execution.

5

What components are involved in CVE-2026-40287?

Components involved in CVE-2026-40287 include call.py and the automatic import functionality in PraisonAI.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203