/

CVE-2026-55522

Severity:

HIGH RISK

(7.8)

Code Injection (CWE-94) in PraisonAI Workflow Include

CVE-2026-55522

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94, CWE-426, CWE-829

Impact:

Arbitrary Python Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

PraisonAI's workflow include feature can execute arbitrary Python code when it loads an untrusted local recipe. The code runs during include setup as the PraisonAI process user, before child workflow parsing or model execution, when an attacker can cause a victim process to run a workflow or recipe referencing that recipe.

Affected context

The issue affects PraisonAI and PraisonAI Agents deployments using the workflow include feature or the higher-level praisonai.recipe.run() API. It becomes risky when a workflow can reference a local recipe directory controlled or modified by an untrusted party, because the included recipe's tools.py is imported directly without the normal opt-in gates or centralized safe-loader protections.

Exploit preconditions

  • Attack surface: Workflow and recipe include processing
  • Required access: Ability to place, modify, or cause selection of an attacker-controlled local recipe
  • Trigger point: Execution of Workflow._execute_include() or the corresponding recipe API
  • Why exploitation is possible: The included tools.py is loaded with raw import machinery, causing module-level Python code to run before child workflow validation or model interaction

Why this happens

The vulnerability results from an include implementation that directly invokes importlib.util.spec_from_file_location() and spec.loader.exec_module() on a recipe's tools.py. This bypasses the application's opt-in controls for template and local tools and avoids the centralized loader intended to enforce safer autoload behavior. The issue maps primarily to CWE-94: Improper Control of Generation of Code, with related characteristics of CWE-426: Untrusted Search Path and CWE-829: Inclusion of Functionality from Untrusted Control Sphere.

Potential impact

  • An attacker may execute arbitrary Python code as the PraisonAI process user
  • The application runtime could be compromised
  • Credentials, files, or environment data accessible to the process could be exposed
  • The host or surrounding services could be affected depending on process privileges and network access
  • Workflows or generated results could be altered or sabotaged

General mitigation guidance

Mitigation generally focuses on treating included recipes and their tools as untrusted code rather than ordinary configuration.

Common defensive patterns include:

  • Route all tool and recipe loading through a centralized, policy-enforcing safe loader
  • Honor explicit opt-in gates before importing local or template-provided tools
  • Restrict workflow includes to trusted, allowlisted directories and artifacts
  • Separate workflow data from executable Python modules where possible
  • Validate recipe provenance and integrity before execution
  • Run PraisonAI processes with least privilege and isolate them from sensitive host resources
  • Reduce inherited credentials, filesystem access, and network permissions for workflow runners

How teams detect issues like this

Organizations can look for this issue through:

  • Static analysis rules identifying direct use of spec_from_file_location() and exec_module() on workflow-controlled paths
  • Code review checks for imports that bypass centralized loaders or security gates
  • Repository searches for automatic tools.py discovery in include and recipe execution paths
  • Policy enforcement that requires allowlists, provenance checks, and explicit consent before loading local modules
  • Runtime monitoring of unexpected Python module imports, child-process creation, and filesystem access during workflow startup
  • Automated security review tools that flag dynamic imports involving untrusted paths

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-hxmv-c4g6-5fqc

Frequently asked

questions

It is not inherently an unauthenticated network vulnerability. Exploitation generally requires that a victim process execute a workflow or recipe that includes an attacker-controlled local recipe, although remote services that accept or retrieve such workflows may expand the attack surface.

The attacker must be able to influence the included recipe directory or cause the victim to run a workflow whose include target is untrusted. The resulting code executes with the permissions of the PraisonAI process.

Use a centralized loader that enforces explicit opt-in gates, trusted-path restrictions, provenance validation, and safe handling of executable tools before any module import occurs.

Treat workflow includes as code execution boundaries, allowlist trusted recipes, separate data from executable modules, apply least privilege, and continuously review dynamic import paths in code and CI security checks.

Find out what's already
exploitable in your codebase.