CVE-2026-40156
HIGH 7.8CVSS 3.1PraisonAI Vulnerable to Implicit Execution of Arbitrary Code via Automatic `tools.py` Loading
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.
- Published
- 10 Apr 2026
- Last modified
- 26 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-426CWE-829CWE-94
- Also known as
- GHSA-2g3w-cpc4-chr4PYSEC-2026-2895
- Sources
- NVDJSONOSV GHSA-2g3w-cpc4-chr4JSONOSV PYSEC-2026-2895JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | praison | praisonaicpe:2.3:a:praison:praisonai:*:*:*:*:*:*:*:* |
< 4.5.128 | 4.5.128 |
| OSV | PyPI | praisonai | < 4.5.128 | 4.5.128 |
References
- https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-2g3w-cpc4-chr4 · 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
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 10 Apr 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 13 Jul 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 10 Apr 2026)