{"id":"CVE-2026-40287","aliases":["GHSA-g985-wjh9-qxxc","PYSEC-2026-2914","PYSEC-2026-2947"],"url":"https://o3.security/vulnerability/CVE-2026-40287","summary":"PraisonAI has 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)","published":"2026-04-14T02:55:38.270Z","modified":"2026-08-12T03:51:38.793625947Z","cvss":{"score":8.4,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"praisonaiagents","fixedVersion":"1.5.140"},{"ecosystem":"PyPI","name":"praisonai","fixedVersion":"4.5.139"}],"fix":null,"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40287.json"},{"type":"ADVISORY","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"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:38.793625947Z"}}