{"id":"CVE-2026-40287","aliases":["CVE-2026-40287","GHSA-g985-wjh9-qxxc","PYSEC-2026-2914","PYSEC-2026-2947"],"related":[],"kind":"vulnerability","state":"published","title":"PraisonAI has RCE via Automatic tools.py Import","summary":"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 (import_tools_from_file()), tool_resolver.py (_load_local_tools()), 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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 (import_tools_from_file()), tool_resolver.py (_load_local_tools()), 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.","source":"cvelist"},{"lang":"en","text":"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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"PraisonAI es un sistema de equipos multiagente. Las versiones 4.5.138 e inferiores son vulnerables a la ejecución de código arbitrario mediante la importación automática y no saneada de un archivo tools.py desde el directorio de trabajo actual. Componentes que incluyen call.py (import_tools_from_file()), tool_resolver.py (_load_local_tools()) y las rutas de carga de herramientas de la CLI importan ciegamente ./tools.py al inicio sin ninguna validación, sandboxing o confirmación del usuario. Un atacante que puede colocar un archivo tools.py malicioso en el directorio donde se inicia PraisonAI (como a través de un proyecto compartido, un repositorio clonado o un espacio de trabajo escribible) logra la ejecución inmediata de código Python arbitrario en el entorno del host. Esto compromete el proceso completo de PraisonAI, el sistema host y cualquier dato o credencial conectado. Este problema ha sido solucionado en la versión 4.5.139.","source":"nvd"}],"published":"2026-04-10T19:32:32.000Z","modified":"2026-10-26T22:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"}],"cwes":["CWE-94","CWE-426"],"affected":[{"ranges":[{"version":"< 4.5.139","status":"affected"}],"vendor":"MervinPraison","product":"PraisonAI","source":"cvelist"},{"ranges":[{"version":"< 1.5.140","status":"affected"}],"vendor":"MervinPraison","product":"praisonaiagents","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.5.140"}],"ecosystem":"PyPI","package":"praisonaiagents","purl":"pkg:pypi/praisonaiagents","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.139"}],"ecosystem":"PyPI","package":"praisonai","purl":"pkg:pypi/praisonai","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.5.139"}],"vendor":"praison","product":"praisonai","cpe":"cpe:2.3:a:praison:praisonai:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","fixed":"1.5.140"}],"vendor":"praison","product":"praisonaiagents","cpe":"cpe:2.3:a:praison:praisonaiagents:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.139"}],"ecosystem":"PyPI","package":"praisonai","purl":"pkg:pypi/praisonai","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.5.140"}],"ecosystem":"PyPI","package":"praisonaiagents","purl":"pkg:pypi/praisonaiagents","source":"pysec"}],"references":[{"url":"https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-g985-wjh9-qxxc","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40287","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/MervinPraison/PraisonAI","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/MervinPraison/PraisonAI/releases/tag/v4.5.139","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/praisonai","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-g985-wjh9-qxxc","tags":["advisory"],"sources":["pysec"]},{"url":"https://pypi.org/project/praisonaiagents","tags":["package"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-04-14T13:23:23.221Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40287","url":"https://www.cve.org/CVERecord?id=CVE-2026-40287","licence":"CVE Terms of Use","modified":"2026-04-14T13:23:29.807Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g985-wjh9-qxxc","url":"https://github.com/advisories/GHSA-g985-wjh9-qxxc","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:33.357Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40287","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40287","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2914","url":"https://osv.dev/vulnerability/PYSEC-2026-2914","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:33.357Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2947","url":"https://osv.dev/vulnerability/PYSEC-2026-2947","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:33.357Z"}],"updatedAt":"2026-11-25T22:59:18.669Z","epss":{"score":0.00256,"percentile":0.18424,"date":"2026-12-01T12:00:22.000Z"}}