/

CVE-2026-35002

Severity:

CRITICAL RISK

(9.8)

Eval Injection / Code Injection in Agno Model Execution

CVE-2026-35002

Analyzed

Vulnerability type

Category:

Eval Injection / Code Injection

CWE:

CWE-95

Impact:

Remote Code Execution

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

Agno versions prior to 2.3.24 contain an eval injection vulnerability in the model execution component, where user-influenced data is passed directly to Python's eval() via the field_type parameter.

An attacker who can control or manipulate field_type within a FunctionCall can execute arbitrary Python code in the Agno process, leading to full remote code execution under the service's privileges.

Affected context

The vulnerability occurs in Agno's model execution logic when evaluating FunctionCall inputs and deriving behavior from the field_type parameter.

It manifests in deployments where:

  • Field values or FunctionCall payloads can be influenced by external users or upstream systems, and
  • The application directly passes this field_type into Python's eval() without sufficient restriction.

Any environment where untrusted or semi-trusted sources can shape FunctionCall parameters may be affected, including API-driven workflows, integrations, or chained model calls.

Exploit preconditions

  • Attack surface: Interfaces that accept or propagate FunctionCall objects or equivalent structures into the model execution component.
  • Required access: Ability to submit or modify FunctionCall data such that field_type is attacker-controlled (e.g., via an API, plugin, or integration).
  • Trigger point: Invocation of the model execution path that processes a FunctionCall and passes field_type to eval().
  • Why exploitation is possible: The implementation treats field_type as trusted code-like input and evaluates it with Python's eval(), allowing arbitrary expressions rather than constraining it to a predefined, data-only set of types.

Why this happens

This issue is rooted in using Python's eval() function on data that can be influenced by external input.

Instead of treating field_type as a simple data descriptor (for example, a string or enum representing a type), the code dynamically evaluates its value, effectively turning untrusted data into executable Python code.

This aligns with CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code, where attackers can inject or alter expressions to run arbitrary commands or access internal objects.

The core pattern is dynamic evaluation of untrusted input without strict whitelisting, sandboxing, or separation between code and data.

Potential impact

  • Execution of arbitrary Python code within the Agno runtime process
  • Reading, modifying, or deleting sensitive data accessible to the service
  • Pivoting to the underlying host or container environment through Python and OS interfaces
  • Installing backdoors or persistent malicious logic in the application environment
  • Complete compromise of application integrity, including tampering with model logic and outputs

General mitigation guidance

Effective mitigation focuses on eliminating dynamic evaluation of untrusted data and narrowing how types are represented:

  • Replace eval() with safe alternatives such as explicit mappings from string identifiers to allowed types or callables.
  • Treat field_type as a data-only value (e.g., enum, constant string, or structured configuration) instead of executable code.
  • Apply strict validation and normalization of FunctionCall parameters, rejecting or sanitizing unexpected type descriptors.
  • Encapsulate model execution in components running with least privilege, limiting filesystem and network access to reduce blast radius.
  • Adopt secure defaults where dynamic behavior is disabled unless explicitly required and constrained.

How teams detect issues like this

Organizations can detect and manage this class of vulnerability using:

  • Static analysis rules flagging use of eval(), exec(), or similar dynamic evaluation functions, especially on variables derived from request or FunctionCall data.
  • Code review practices that require explicit justification for dynamic evaluation and enforce patterns like whitelisting instead of free-form expressions.
  • Security linters or CI checks tuned to identify eval injection patterns (e.g., concatenation or direct flow from input parameters to eval()).
  • Runtime monitoring and logging of suspicious FunctionCall payloads or abnormal execution paths within model execution components.

Sources

SourceLink
github.comgithub.com/agno-agi/agno/commit/cbf675521d4d2281925a051784a3b94172e56416
github.comgithub.com/agno-agi/agno/releases/tag/v2.3.24
vulncheck.comvulncheck.com/advisories/agno-field-type-eval-injection-arbitrary-code-execution

Frequently asked

questions

Exploitability depends on who can influence FunctionCall data.

In scenarios where external users or integrated systems can shape the field_type parameter, the vulnerability can be exploited remotely and reliably to achieve code execution.

The attacker must be able to submit or modify FunctionCall objects, or any upstream data that is mapped into field_type.

This typically means access to an API endpoint, integration channel, or service that ultimately drives the model execution logic.

Remove or isolate eval() and similar dynamic evaluation from the code path.

Implement a strict mapping between allowed field_type values and their behaviors, so that only known, static, and vetted options are used, with no direct evaluation of user-controlled expressions.

Avoid dynamic code evaluation on any value that can be influenced by external input; model configuration and types should be data, not code.

Combine this with secure-by-default coding guidelines, static analysis for eval/exec usage, thorough code review of dynamic behavior, and least-privilege runtime configurations.

Find out what's already
exploitable in your codebase.