CVE-2026-62176: PraisonAI Code Injection Vulnerability
CRITICALCVE-2026-62176 is a CRITICAL (CVSS 9.1) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting PraisonAI libraries in the PyPI ecosystem. The issue involves code injection via f-string interpolation in deploy api server generation. Remediation is available by upgrading affected packages to version 4.6.78.
CVE-2026-62176 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-62176
To remediate this vulnerability, upgrade all affected PraisonAI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install PraisonAI>=4.6.78
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show PraisonAI
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-62176, inspect your installed packages using pip:
pip show PraisonAI
Analyze the terminal output to locate any version of PraisonAI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6.78), your application is affected.
Note: The pip show PraisonAI command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In PraisonAI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-62176 Affected PraisonAI Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
PraisonAI
|
PyPI |
< 4.6.78
|
4.6.78
|
References
Frequently Asked Questions
What is CVE-2026-62176?
Which PraisonAI versions are affected?
What version fixes CVE-2026-62176?
Is PraisonAI affected?
What is the CVSS score of CVE-2026-62176?
What CWE is associated with CVE-2026-62176?
How can I check PyPI dependencies for CVE-2026-62176?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-g6j7-pffp-8whg",
"modified" : "2026-10-07T16:05:53Z",
"published" : "2026-10-07T16:05:53Z",
"aliases" : [ "CVE-2026-62176" ],
"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",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "PraisonAI"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.6.78"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.6.77"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-g6j7-pffp-8whg"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/MervinPraison/PraisonAI"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-07T16:05:53Z",
"nvd_published_at" : null
}
}