CVE-2026-61437: PraisonAI Unsafe Dynamic Module Loading Remote Code Execution
PraisonAI, a Python framework for building agent-based workflows, contains a code execution vulnerability in versions before 1.6.78. When processing workflow files that reference Pydantic models as strings, the framework automatically loads a sibling tools.py file from the same directory without proper security checks. An attacker who can place or modify both the workflow configuration and tools.py file can inject malicious Python code that executes with full privileges when the workflow runs. This is a local attack vector requiring file system access, but the impact is severe—complete code execution in the context of the application using PraisonAI.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.8 HIGH · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Weaknesses (CWE)
- CWE-693
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-07-10 / 2026-07-14
NVD description (verbatim)
PraisonAI (pip package praisonaiagents) before 1.6.78 contains an unsafe dynamic module loading vulnerability in AgentFlow._resolve_pydantic_class (src/praisonai-agents/praisonaiagents/workflows/workflows.py). When a workflow step uses a string output_pydantic reference, the framework locates and imports a sibling tools.py from the workflow file's directory via importlib exec_module without sandboxing, ignoring the PRAISONAI_ALLOW_*_TOOLS environment variables. An attacker who controls a workflow file and its sibling tools.py can execute arbitrary Python code with the workflow runner's privileges when the workflow is executed via WorkflowManager or after load_yaml.
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in AgentFlow._resolve_pydantic_class() within the workflows module. When a workflow step specifies a Pydantic model output via a string reference, the code dynamically imports a tools.py module from the workflow file's directory using importlib.exec_module(). This dynamic loading bypasses the security-relevant PRAISONAI_ALLOW_*_TOOLS environment variables that are designed to control what tools can be loaded. The lack of sandboxing means any Python code in the imported tools.py executes unconditionally. An attacker gaining write access to workflow configuration files and their sibling directory can weaponize this to achieve arbitrary code execution—the severity is amplified because it affects any application or pipeline that processes untrusted or attacker-controlled workflow definitions.
Business impact
Organizations using PraisonAI in production automation, multi-tenant SaaS platforms, or shared development environments face direct code execution risk. If an attacker compromises a workflow file (via supply chain, insider threat, or misconfigured repository access), they gain the same privileges as the WorkflowManager process—potentially accessing secrets, modifying data, or establishing persistence. DevOps pipelines that auto-load workflows are particularly exposed. The primary risk scenario is environments where workflow files come from less-trusted sources or where directory permissions are not tightly controlled.
Affected systems
PraisonAI versions before 1.6.78 are vulnerable. This affects any Python application that installs the praisonaiagents pip package and invokes WorkflowManager.run() or load_yaml() on workflow files. Exposure is highest in: (1) AI/ML automation platforms using PraisonAI as an orchestration layer, (2) CI/CD or MLOps pipelines that dynamically load workflows, (3) multi-user or multi-tenant environments where workflow files may be user-supplied, and (4) containerized deployments where the workflow runner identity has broad system access.
Exploitability
Exploitability requires local file system write access to both a workflow configuration file and its sibling tools.py directory. This is not remotely exploitable over the network in isolation, but is highly exploitable if: an attacker can commit to a repository containing workflows, gains access to a shared filesystem, or can manipulate files uploaded to a system before processing. The UI/user interaction requirement in the CVSS vector reflects that a user or process must explicitly execute the workflow. Once those preconditions are met, exploitation is trivial—any valid Python code in tools.py will execute automatically without additional user interaction or detection evasion.
Remediation
Upgrade PraisonAI to version 1.6.78 or later immediately. The patch hardens the dynamic module loading by enforcing the PRAISONAI_ALLOW_*_TOOLS environment variable checks and restricting unpredictable tool imports. Additionally, implement preventive controls: (1) restrict write permissions on workflow file directories to trusted accounts only, (2) use code review for any workflow configuration changes, (3) run workflow processes with minimal necessary privileges (principle of least privilege), and (4) consider using signed or attested workflow files if deploying from shared sources.
Patch guidance
Verify the installed version using 'pip show praisonaiagents' or your dependency management tool. Update using 'pip install --upgrade praisonaiagents' to pull version 1.6.78 or later from PyPI. For pinned dependencies in requirements.txt or poetry.lock, update the constraint and re-lock. Test workflows in a staging environment after patching to confirm compatibility. If you have older deployments, prioritize patching based on whether they process untrusted or user-supplied workflow definitions.
Detection guidance
Monitor for suspicious imports or code execution originating from tools.py files co-located with workflow configurations. Log and alert on: (1) importlib.exec_module() calls within the PraisonAI codebase or workflow execution, (2) unexpected process spawn or network activity initiated from workflow runners, (3) modifications to tools.py files in production or CI/CD workflow directories. Forensically, check Git history, file modification timestamps, and process execution logs around the time workflows were loaded to identify unauthorized changes.
Why prioritize this
This vulnerability merits urgent patching despite the local-access requirement because: (1) it enables unauthenticated arbitrary code execution once file-system access is obtained, (2) it affects a growing ecosystem of AI/ML automation tools where workflow files are frequently automated or user-supplied, (3) the security controls (PRAISONAI_ALLOW_*_TOOLS) that should prevent this are completely bypassed, and (4) the blast radius in CI/CD or shared infrastructure contexts is very high. HIGH severity (7.8 CVSS) is appropriate. Organizations should patch within 1–2 weeks depending on exposure profile.
Risk score, explained
CVSS 7.8 (HIGH) reflects: confidentiality, integrity, and availability all high impact (the attacker gains full code execution), local attack vector (requires file-system write access), no privilege escalation required (runs as the workflow process user), and no network isolation (attack succeeds in standard deployment). The score would be CRITICAL if the vector were AV:N, but local-only access prevents that. However, in cloud-native and CI/CD environments where workflows are pervasively orchestrated, the practical risk may exceed the CVSS score.
Frequently asked questions
Can this vulnerability be exploited remotely without file system access?
No. The attack requires the ability to write or modify both a workflow configuration file and a sibling tools.py file on the target system's filesystem. Remote exploitation is not possible in isolation, though an attacker could achieve file-system write access through other means (e.g., supply chain compromise, insecure upload endpoint, or Git repository access).
Do the PRAISONAI_ALLOW_*_TOOLS environment variables protect against this?
In the vulnerable versions, no—that is the core issue. The environment variables are intended to control tool imports, but AgentFlow._resolve_pydantic_class() bypasses these checks when dynamically loading tools.py. Version 1.6.78 and later enforce these controls properly.
What if I run my workflow processes in a container or sandbox?
Sandboxing and principle-of-least-privilege deployment (e.g., read-only filesystem for workflows, restricted user identity) significantly reduce blast radius. However, they do not eliminate the vulnerability—malicious code still executes within that container or user context. Patching remains the proper fix.
Are there known public exploits for CVE-2026-61437?
As of the vulnerability's publication date (July 2026), no public exploit code or KEV database listing exists. However, the vulnerability is straightforward to exploit if file access is available, so assume potential for rapid weaponization if organizations delay patching.
This analysis is based on the CVE description and public vulnerability data current as of the publication date. Patch version numbers and availability should be verified directly from the PyPI repository and PraisonAI vendor advisories. Organizations should test patches in a non-production environment before deployment. SEC.co does not provide legal, compliance, or risk management advice—consult your security team and risk management processes for guidance specific to your environment and regulatory obligations. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2025-24284HIGHmacOS Sandbox Escape Vulnerability – Sequoia 15.4 Patch Required
- CVE-2025-48649HIGHAndroid Local Privilege Escalation via Permission Bypass
- CVE-2025-48652HIGHAndroid MDM Bypass Logic Flaw – HIGH Severity Privilege Escalation
- CVE-2025-71322HIGHPickleScan Unsafe Globals Bypass – pty.spawn RCE Vulnerability
- CVE-2025-71352HIGHpicklescan Detection Bypass via trace.Trace.runctx Gadget
- CVE-2025-71373HIGHpicklescan Operator.methodcaller Bypass – Detection Evasion in Python Pickle Validation
- CVE-2026-0045HIGHAndroid Bluetooth Bonding Bypass Privilege Escalation
- CVE-2026-0077HIGHAndroid ActivityRecord Privilege Escalation Vulnerability