{"cve":"CVE-2026-40156","nvd":{"published":"2026-04-10T17:17:13.297","modified":"2026-10-26T21:10:00.170","status":"Analyzed","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8},"cwes":["CWE-94","CWE-426","CWE-829"],"references":["https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-2g3w-cpc4-chr4","https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-2g3w-cpc4-chr4"],"products":["praison:praisonai"],"source":"nvd","synced_at":"2026-10-26T21:38:48.864438205+00:00"},"epss":{"cve":"CVE-2026-40156","score":0.00209,"percentile":0.10971,"date":"2026-10-26"},"kev":null,"osv":[{"id":"GHSA-2g3w-cpc4-chr4","url":"https://osv.dev/vulnerability/GHSA-2g3w-cpc4-chr4","summary":"PraisonAI Vulnerable to Implicit Execution of Arbitrary Code via Automatic `tools.py` Loading","modified":"2026-07-13T16:42:28.621893643Z","packages":[{"ecosystem":"PyPI","name":"praisonai","purl":"pkg:pypi/praisonai","ranges":["<4.5.128"],"fixed":["4.5.128"]}]},{"id":"PYSEC-2026-2895","url":"https://osv.dev/vulnerability/PYSEC-2026-2895","summary":"PraisonAI Vulnerable to Implicit Execution of Arbitrary Code via Automatic `tools.py` Loading","modified":"2026-07-13T16:32:48.264967581Z","packages":[{"ecosystem":"PyPI","name":"praisonai","purl":"pkg:pypi/praisonai","ranges":["<4.5.128"],"fixed":["4.5.128"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}