/

CVE-2026-61444

Severity:

CRITICAL RISK

(9.1)

Code Injection (CWE-94) in PraisonAI Deployment API

CVE-2026-61444

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code Execution

Severity:

CRITICAL RISK

(9.1)

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 versions prior to 4.6.78 contain a code injection flaw where the agents_file parameter is directly interpolated into an f-string and later executed as Python code.

An attacker who can influence this parameter may execute arbitrary Python instructions when the generated server code is launched via subprocess.Popen().

Affected context

The vulnerability appears in the deployment API path of PraisonAI, specifically within deploy/api.py where dynamic server code is generated.

It is relevant in environments that programmatically construct server-side Python code from user-influenced inputs, and then start that code using subprocess.Popen() or similar execution mechanisms.

The risk is most pronounced when agents_file can be supplied or modified by external clients, configuration interfaces, or automation pipelines without strong validation or isolation.

Exploit preconditions

  • Attack surface: API or configuration interface that sets the agents_file parameter used by deploy/api.py.
  • Required access: Ability to control or significantly influence agents_file (e.g., via HTTP requests, CLI arguments, or config files).
  • Trigger point: Code generation step that interpolates agents_file into an f-string and subsequently launches the resulting script via subprocess.Popen().
  • Why exploitation is possible: The application treats agents_file as trusted, directly embedding it into executable Python code without sanitization, escaping, or separation of code and data.

Why this happens

This issue stems from dynamically constructing Python source code using untrusted data and then executing that code.

By interpolating agents_file into an f-string, the application allows attacker-controlled content to become part of the program logic itself rather than remaining plain data.

This pattern maps to CWE-94: Improper Control of Generation of Code, where user input influences code generation or execution paths, enabling arbitrary code execution if not strictly constrained.

Potential impact

  • Execution of arbitrary Python code under the PraisonAI service account
  • Reading, modifying, or deleting application and user data accessible to the process
  • Pivoting to the underlying host or container environment, depending on permissions
  • Deployment of backdoors, logic tampering, or persistent malicious behavior in generated servers
  • Disruption or denial of service by crashing or overloading the deployment process

General mitigation guidance

Mitigation focuses on ensuring that untrusted input cannot be treated as executable code.

Common defensive approaches include:

  • Avoiding dynamic code generation where possible, or constraining it to fixed templates with strictly validated parameters.
  • Treating agents_file and similar parameters as pure data, passing them as arguments or configuration values rather than embedding them into code strings.
  • Applying allowlisting and strict parsing for file names, identifiers, and paths, rejecting unexpected characters or constructs.
  • Isolating any unavoidable code generation in a tightly sandboxed, least-privilege environment with minimal access to sensitive resources.
  • Designing deployment mechanisms to use structured configuration formats (e.g., JSON, YAML) instead of string-based code templates.

How teams detect issues like this

Detection typically involves reviewing both code patterns and runtime behavior:

  • Static analysis rules that flag string interpolation or concatenation used to build Python source code, especially when combined with exec, eval, dynamic imports, or subprocess execution.
  • Code review checklists that highlight any use of user-controlled inputs in f-strings or templates that ultimately produce executable code.
  • Enforcement of policies banning dynamic code evaluation in deployment logic, backed by automated checks in CI/CD pipelines.
  • Runtime monitoring for unusual subprocess invocations or unexpected Python scripts launched by the deployment component, which may indicate exploitation attempts.

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-g6j7-pffp-8whg
vulncheck.comvulncheck.com/advisories/praisonai-before-code-injection-via-f-string

Frequently asked

questions

It can be remotely exploitable if the agents_file parameter is controlled via a network-exposed API or service endpoint; otherwise, exploitation is limited to whoever can modify that configuration input.

The attacker needs the ability to set or influence agents_file in the context where deploy/api.py generates and launches the server code, which may be through authenticated APIs, configuration files, or automation scripts.

The safest pattern is to remove dynamic code generation from untrusted input paths, treating all user-influenced values as data only, and enforcing strict validation or allowlists for parameters that feed into deployment logic.

Establish a design rule that prohibits dynamic code execution from user-controlled inputs, enforce it with code reviews and static analysis, and favor configuration-driven architectures that separate data from executable logic.

Find out what's already
exploitable in your codebase.