{"id":"CVE-2026-62176","aliases":["CVE-2026-62176","GHSA-g6j7-pffp-8whg","PYSEC-2026-4256"],"related":["CVE-2026-61444"],"kind":"vulnerability","state":"published","title":"PraisonAI: Code Injection via f-string Interpolation in Deploy API Server Generation","summary":"PraisonAI is a multi-agent teams system. Prior to version 4.6.78, the `deploy/api.py` module generates Python server code by directly interpolating the `agents_file` parameter into an f-string that is then written to a file and executed via `subprocess.Popen()`. An attacker who controls the `agents_file` value (via CLI argument, configuration, or upstream API) can inject arbitrary Python code. Version 4.6.78 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"PraisonAI is a multi-agent teams system. Prior to version 4.6.78, the `deploy/api.py` module generates Python server code by directly interpolating the `agents_file` parameter into an f-string that is then written to a file and executed via `subprocess.Popen()`. An attacker who controls the `agents_file` value (via CLI argument, configuration, or upstream API) can inject arbitrary Python code. Version 4.6.78 patches the issue.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe `deploy/api.py` module generates Python server code by directly interpolating the `agents_file` parameter into an f-string that is then written to a file and executed via `subprocess.Popen()`. An attacker who controls the `agents_file` value (via CLI argument, configuration, or upstream API) can inject arbitrary Python code.\n\n### Details\n\n`src/praisonai/praisonai/deploy/api.py` (line 80):\n\n```python\ncode = f'''...\n    praisonai = PraisonAI(agent_file=\"{agents_file}\")\n...\n    \"agent_file\": \"{agents_file}\"\n...'''\n```\n\nThe generated code is then executed (line 190):\n```python\nsubprocess.Popen(['python', server_file])\n```\n\n`agents_file` is never sanitized or validated. A malicious value breaks out of the string context:\n\n```python\nagents_file = '\"); import os; os.system(\"id\"); #'\n# Generated code becomes:\n# praisonai = PraisonAI(agent_file=\"\"); import os; os.system(\"id\"); #\")\n```\n\nThe same pattern exists in `deploy/docker.py` (line 33) for Dockerfile generation.\n\n\n### PoC\n\n```python\n# The injection:\nagents_file = '\"); import os; os.system(\"id\"); #'\n\n# What the generated code looks like:\ntemplate = f'praisonai = PraisonAI(agent_file=\"{agents_file}\")'\nprint(template)\n# Output: praisonai = PraisonAI(agent_file=\"\"); import os; os.system(\"id\"); #\")\n```\n\n### Impact\n- **Arbitrary code execution** on the machine running the deploy command\n- **Supply chain risk** if `agents_file` comes from a configuration file or CI/CD pipeline","format":"markdown","source":"ghsa"}],"published":"2026-10-07T16:05:53.000Z","modified":"2026-10-15T14:56:12.523Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"< 4.6.78","status":"affected"}],"vendor":"MervinPraison","product":"PraisonAI","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.6.78"}],"ecosystem":"PyPI","package":"praisonai","purl":"pkg:pypi/praisonai","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.6.78"}],"ecosystem":"PyPI","package":"praisonai","purl":"pkg:pypi/praisonai","source":"pysec"}],"references":[{"url":"https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-g6j7-pffp-8whg","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/MervinPraison/PraisonAI","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/praisonai","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-g6j7-pffp-8whg","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62176","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-10-07T16:57:09.228Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-62176","url":"https://www.cve.org/CVERecord?id=CVE-2026-62176","licence":"CVE Terms of Use","modified":"2026-10-07T16:57:30.065Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g6j7-pffp-8whg","url":"https://github.com/advisories/GHSA-g6j7-pffp-8whg","licence":"CC-BY-4.0","modified":"2026-10-15T14:56:12.523Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-62176","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62176","licence":"Public domain","modified":"2026-10-07T17:16:56.153Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4256","url":"https://osv.dev/vulnerability/PYSEC-2026-4256","licence":"CC-BY-4.0","modified":"2026-10-15T14:56:12.523Z"}],"updatedAt":"2026-11-25T22:59:43.058Z","epss":{"score":0.0046,"percentile":0.41617,"date":"2026-12-01T12:00:22.000Z"}}