CVE-2026-47398: PraisonAI: RCE via ungated exec_module in agent config
GHSA-78r8-wwqv-r299 HIGH PoC AVAILABLE CISA: ATTENDPraisonAI versions up to 4.6.37 contain two unguarded `spec.loader.exec_module` call sites in `agents_generator.py` that execute arbitrary Python files referenced from YAML agent configurations, bypassing the env-var gate applied in three prior patch rounds (CVE-2026-40156, CVE-2026-40287, CVE-2026-44334). With the recipe server's default no-auth posture and `allow_any_github=True`, an unauthenticated attacker can achieve remote code execution via a single HTTP POST request — a public PoC bash script is included in the advisory, placing weaponization within reach of unsophisticated actors. The 59 other CVEs in this package and a systemic pattern of incomplete patch series signal structural security debt that should raise red flags for any team running PraisonAI in production or CI/CD. Upgrade to praisonai >= 4.6.40 immediately; if patching is blocked, restrict or disable the `/v1/recipes/run` endpoint and ensure `allow_any_github` is set to false.
What is the risk?
Critical risk in network-facing deployments. The structured CVE data scores this 8.1 High (AV:N/AC:H); the advisory escalates to 9.8 Critical when the recipe server runs with default no-auth settings and allow_any_github=True — both common in out-of-the-box deployments. This is the fourth bypass in a series of incomplete patches targeting the same exec_module sink family, meaning the maintainers' track record of fully closing the attack surface is poor and future patches warrant scrutiny. With a trivial public PoC and no authentication requirement in the network vector, exploitation probability is high regardless of low current EPSS data (CVE is newly published). AI agent frameworks running in CI/CD pipelines, shared development environments, or multi-tenant SaaS platforms face the broadest blast radius.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| PraisonAI | pip | <= 4.6.39 | 4.6.40 |
Do you use PraisonAI? You're affected.
How severe is it?
What is the attack surface?
What should I do?
6 steps-
Upgrade to praisonai >= 4.6.40 — the only confirmed remediation.
-
If upgrade is blocked: set PRAISONAI_ALLOW_LOCAL_TOOLS to any value other than 'true' (note: agents_generator.py does NOT check this gate, so it only helps other sinks — treat as defense-in-depth, not a fix).
-
Disable or place behind strong authentication the /v1/recipes/run endpoint; explicitly set allow_any_github=False in recipe server config.
-
Audit all agents.yaml files in use for unexpected module_path entries referencing .py files, especially relative paths.
-
Detection: alert on Python process execution spawning from /tmp or unexpected working directories; watch for file writes matching praisonai_*_pwn_*.txt in /tmp as PoC fingerprint.
-
In CI/CD contexts, pin the praisonai version and validate YAML agent configs against a strict schema — reject any config containing module_path keys that reference filesystem paths.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-47398?
PraisonAI versions up to 4.6.37 contain two unguarded `spec.loader.exec_module` call sites in `agents_generator.py` that execute arbitrary Python files referenced from YAML agent configurations, bypassing the env-var gate applied in three prior patch rounds (CVE-2026-40156, CVE-2026-40287, CVE-2026-44334). With the recipe server's default no-auth posture and `allow_any_github=True`, an unauthenticated attacker can achieve remote code execution via a single HTTP POST request — a public PoC bash script is included in the advisory, placing weaponization within reach of unsophisticated actors. The 59 other CVEs in this package and a systemic pattern of incomplete patch series signal structural security debt that should raise red flags for any team running PraisonAI in production or CI/CD. Upgrade to praisonai >= 4.6.40 immediately; if patching is blocked, restrict or disable the `/v1/recipes/run` endpoint and ensure `allow_any_github` is set to false.
Is CVE-2026-47398 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2026-47398, increasing the risk of exploitation.
How to fix CVE-2026-47398?
1. Upgrade to praisonai >= 4.6.40 — the only confirmed remediation. 2. If upgrade is blocked: set PRAISONAI_ALLOW_LOCAL_TOOLS to any value other than 'true' (note: agents_generator.py does NOT check this gate, so it only helps other sinks — treat as defense-in-depth, not a fix). 3. Disable or place behind strong authentication the /v1/recipes/run endpoint; explicitly set allow_any_github=False in recipe server config. 4. Audit all agents.yaml files in use for unexpected module_path entries referencing .py files, especially relative paths. 5. Detection: alert on Python process execution spawning from /tmp or unexpected working directories; watch for file writes matching praisonai_*_pwn_*.txt in /tmp as PoC fingerprint. 6. In CI/CD contexts, pin the praisonai version and validate YAML agent configs against a strict schema — reject any config containing module_path keys that reference filesystem paths.
What systems are affected by CVE-2026-47398?
This vulnerability affects the following AI/ML architecture patterns: Agent frameworks, CI/CD AI pipelines, Multi-tenant agent platforms, Recipe and automation servers.
What is the CVSS score for CVE-2026-47398?
CVE-2026-47398 has a CVSS v3.1 base score of 8.1 (HIGH). The EPSS exploitation probability is 0.33%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0002.002 AI Agent Configuration AML.T0010.005 AI Agent Tool AML.T0049 Exploit Public-Facing Application AML.T0053 AI Agent Tool Invocation AML.T0081 Modify AI Agent Configuration Compliance Controls Affected
What are the technical details?
Original Advisory
PraisonAI is a multi-agent teams system. The v4.6.32 chokepoint refactor (which patched CVE-2026-44334 / GHSA-xcmw-grxf-wjhj) added the PRAISONAI_ALLOW_LOCAL_TOOLS env-var gate to the tool_override.py sinks. However, two additional spec.loader.exec_module call sites in praisonai/agents_generator.py were missed and remain completely unguarded in versions prior to 4.6.40. Both functions accept a module_path parameter sourced from YAML configuration and execute it without validation, signature checking, or the env-var gate. Version 4.6.40 fixes the issue.
Exploitation Scenario
An attacker creates a public GitHub repository containing two files: evil.py (which exfiltrates environment variables including AI API keys and writes a persistence mechanism) and agents.yaml declaring a poc_agent with tools referencing module_path: ./evil.py. They send an unauthenticated HTTP POST to the target's recipe server at POST /v1/recipes/run with body {"recipe": "github:attacker/repo/recipe"}. PraisonAI fetches the recipe, parses agents.yaml, and calls AgentsGenerator.load_tools_from_module('./evil.py'). Since agents_generator.py line 351 calls spec.loader.exec_module(module) with no PRAISONAI_ALLOW_LOCAL_TOOLS check, evil.py executes immediately with the privileges of the PraisonAI process — before any LLM interaction, before any API authentication, before any output filtering. The attacker harvests credentials, pivots to connected databases or vector stores, and plants a backdoor — all in the tool-loading phase that the application treats as infrastructure setup.
Weaknesses (CWE)
CWE-829 Inclusion of Functionality from Untrusted Control Sphere
Primary
CWE-829 Inclusion of Functionality from Untrusted Control Sphere
Primary
CWE-94 Improper Control of Generation of Code ('Code Injection')
Primary
CWE-94 Improper Control of Generation of Code ('Code Injection')
Primary
CWE-829 Inclusion of Functionality from Untrusted Control Sphere CWE-94 Improper Control of Generation of Code ('Code Injection') CWE-829 — Inclusion of Functionality from Untrusted Control Sphere: The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.
- [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
- [Architecture and Design] When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs. For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-45] provide this capability.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2026-61447 10.0 PraisonAI: RCE via unsandboxed LLM code execution
Same package: praisonai CVE-2026-61445 9.9 PraisonAI: AICoder root RCE via unsanitized tool calls
Same package: praisonai CVE-2026-47392 9.9 praisonaiagents: RCE via Python sandbox bypass
Same package: praisonai GHSA-vmmj-pfw7-fjwp 9.9 praisonai: sandbox escape gives RCE via codeMode tool
Same package: praisonai GHSA-vc46-vw85-3wvm 9.8 PraisonAI: RCE via malicious workflow YAML execution
Same package: praisonai