/

CVE-2026-47391

Severity:

CRITICAL RISK

(9.8)

Unauthenticated eval() Tool (CWE-95) in PraisonAI A2A

CVE-2026-47391

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-95, CWE-306

Impact:

Remote Code Execution and Data Exposure

Severity:

CRITICAL RISK

(9.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 first-party A2A server example exposes an unauthenticated JSON-RPC endpoint that registers a calculate(expression) tool implemented via Python eval().

When deployed as documented and bound to 0.0.0.0, a remote unauthenticated attacker can drive an LLM to invoke this tool, leading to arbitrary Python code execution and exposure of task metadata.

Affected context

The vulnerability appears in PraisonAI deployments that follow the official A2A example or similar configurations where:

  • The A2A JSON-RPC server is exposed on a network interface (e.g., bound to 0.0.0.0)
  • No authentication or access control is enforced on /a2a
  • Tools such as calculate(expression) are implemented using Python eval() or equivalent dynamic code evaluation
  • A real LLM backend is configured and capable of invoking registered tools

In this context, the A2A surface not only performs tool calls but also exposes task history and cancellation APIs.

Exploit preconditions

  • Attack surface: Publicly reachable HTTP endpoint /a2a on the A2A JSON-RPC server
  • Required access: None; the endpoint is unauthenticated and accessible to any remote client able to connect
  • Trigger point: An attacker sends crafted message/send requests that reach agent.chat(), prompting the LLM to invoke the calculate(expression) tool
  • Why exploitation is possible: The calculate tool directly passes unvalidated expression input to Python eval(), and the tool is callable without any authentication or privilege checks; the same surface also exposes task history and cancellation functionality without authorization.

Why this happens

This issue stems from combining dynamic code execution with an unauthenticated remote interface.

The calculate(expression) tool uses Python's eval() on attacker-controlled input, which is the core pattern behind CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code.

At the same time, the A2A JSON-RPC endpoint is exposed without authentication (CWE-306: Missing Authentication for Critical Function), allowing arbitrary remote users to trigger the tool through LLM-driven workflows.

The design implicitly trusts LLM tool calls and external clients, failing to enforce clear trust boundaries or limit what expressions can be evaluated.

Potential impact

  • Remote attackers can execute arbitrary Python code within the A2A server process
  • Full compromise of the host running the A2A server, depending on process privileges
  • Unauthorized access to task history, including potentially sensitive prompts, responses, and metadata
  • Unauthorized task cancellation or manipulation, affecting system integrity and workflow reliability
  • Use of the compromised server as a pivot point for further attacks in the surrounding infrastructure

General mitigation guidance

Effective mitigation focuses on both hardening the evaluation mechanism and constraining access to the A2A surface:

  • Replace dynamic evaluation (eval() or similar) with safe interpreters or constrained expression evaluators that operate on a limited grammar and data types
  • Enforce robust authentication and authorization on A2A endpoints, ensuring only trusted clients can issue message/send and task-control requests
  • Explicitly separate internal tool execution interfaces from public-facing APIs, using network-level controls and segmentation
  • Run A2A services with least-privilege accounts and minimal filesystem and network permissions to contain impact if a tool is abused
  • Adopt a default-deny posture for tool registration, only enabling tools that operate on validated, non-executable input

How teams detect issues like this

Detection can rely on a mix of code-centric and operational approaches:

  • Static analysis rules or linters configured to flag use of eval() and similar dynamic execution functions in network-exposed or LLM tool contexts
  • Code review checklists that require explicit justification for any dynamic code evaluation and verification of authentication on JSON-RPC or HTTP endpoints
  • Configuration and policy checks ensuring no A2A endpoints bind to 0.0.0.0 without explicit access controls or network restrictions
  • Runtime logging and monitoring for unusual tool invocation patterns, especially expressions containing suspicious Python constructs or filesystem/process operations
  • Periodic security testing of LLM tool chains to identify where user-controlled inputs can reach dynamic execution paths

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/commit/e0fb8e7dd1ee6759c18ed07f436c21dbd9c20747
github.comgithub.com/MervinPraison/PraisonAI/pull/1793
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-vg22-4gmj-prxw

Frequently asked

questions

Yes, if the A2A example server (or similar deployment) is bound to 0.0.0.0 or otherwise reachable from untrusted networks, a remote attacker can exploit it without prior access.

The vulnerable setup requires no authentication; an attacker only needs network connectivity to the exposed /a2a JSON-RPC endpoint to send crafted message/send requests and drive the LLM to invoke the calculate tool.

The safest pattern is to eliminate dynamic code evaluation from tools by replacing eval() with constrained evaluators, while simultaneously enforcing strong authentication and authorization on all A2A endpoints that can trigger tool execution or control tasks.

Future designs should treat LLM tools as untrusted entry points: avoid dynamic execution of tool inputs, apply strict input validation, require authentication for any tool-invoking endpoint, and incorporate security review and automated checks for dangerous primitives like eval() in network-facing code.

Find out what's already
exploitable in your codebase.