# CVE-2026-40156: PraisonAI Affected by Implicit Execution of Arbitrary Code via Automatic `tools.py` Loading

- Severity: High 7.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 13% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-04-10T16:46:15.807Z
- Modified: 2026-10-26T21:10:00.170Z
- Also known as: GHSA-2g3w-cpc4-chr4, PYSEC-2026-2895
- Weaknesses: CWE-94, CWE-426, CWE-829
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

PraisonAI is a multi-agent teams system. Prior to 4.5.128, PraisonAI automatically loads a file named tools.py from the current working directory to discover and register custom agent tools. This loading process uses importlib.util.spec_from_file_location and immediately executes module-level code via spec.loader.exec_module() without explicit user consent, validation, or sandboxing. The tools.py file is loaded implicitly, even when it is not referenced in configuration files or explicitly requested by the user. As a result, merely placing a file named tools.py in the working directory is sufficient to trigger code execution. This behavior violates the expected security boundary between user-controlled project files (e.g., YAML configurations) and executable code, as untrusted content in the working directory is treated as trusted and executed automatically. If an attacker can place a malicious tools.py file into a directory where a user or automated system (e.g., CI/CD pipeline) runs praisonai, arbitrary code execution occurs immediately upon startup, before any agent logic begins.  This vulnerability is fixed in 4.5.128.

(As written by CVE List.)

## Affected

- MervinPraison PraisonAI: < 4.5.128
- praisonai (PyPI): before 4.5.128
- praison praisonai: before 4.5.128

## Every score

- GitHub_M: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-2g3w-cpc4-chr4> (exploit, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40156> (advisory)
- <https://github.com/MervinPraison/PraisonAI> (package)
- <https://github.com/MervinPraison/PraisonAI/releases/tag/v4.5.128> (web)
- <https://pypi.org/project/praisonai> (package)
- <https://github.com/advisories/GHSA-2g3w-cpc4-chr4> (advisory)

## Sources

- CVE List: [CVE-2026-40156](https://www.cve.org/CVERecord?id=CVE-2026-40156), CVE Terms of Use, modified 2026-04-13
- GitHub Advisory Database: [GHSA-2g3w-cpc4-chr4](https://github.com/advisories/GHSA-2g3w-cpc4-chr4), CC-BY-4.0, modified 2026-07-13
- NVD: [CVE-2026-40156](https://nvd.nist.gov/vuln/detail/CVE-2026-40156), Public domain, modified 2026-10-26
- PyPA Advisory Database: [PYSEC-2026-2895](https://osv.dev/vulnerability/PYSEC-2026-2895), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-40156 · Whole record: https://cve.day/CVE-2026-40156.json · Rebuilt by cve.day 2026-11-25T22:59:18.528Z
