/

CVE-2026-76832

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in Agno PythonTools Component

CVE-2026-76832

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Access and Code Execution

Severity:

HIGH RISK

(8.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

A path traversal vulnerability in Agno's PythonTools allows an attacker to escape the intended base directory by controlling the file_name argument. Depending on the selected tool action and the process user's permissions, this may enable arbitrary file reads, file writes, or Python code execution.

Affected context

The issue occurs in deployments that expose Agno's PythonTools actions for reading files, saving files, or running Python files. It becomes risky when an attacker can influence tool arguments directly or through agent-processed content, and when the application relies on a configured base directory without securely resolving and enforcing the resulting path.

Exploit preconditions

  • Attack surface: Agno PythonTools file-operation and Python-file execution actions
  • Required access: Ability to invoke the affected tools directly or influence content processed by an agent
  • Trigger point: A user-controlled file_name value reaches read_file, save_to_file, or run_python_file
  • Why exploitation is possible: Parent-directory traversal is not sufficiently constrained to the intended base_dir, allowing filesystem operations outside that boundary

Why this happens

The vulnerability is caused by treating an attacker-controlled path as if it were confined to a trusted directory without reliably canonicalizing and validating the final resolved location. Path traversal sequences can cause filesystem operations to resolve outside the permitted root. This maps to CWE-22, Improper Limitation of a Pathname to a Restricted Directory, and the risk is amplified when the same path-handling flaw reaches file-writing or code-execution functionality.

Potential impact

  • An attacker may read sensitive application, configuration, or operating-system files.
  • An attacker could overwrite files accessible to the process user.
  • An attacker may alter application behavior or persist malicious content.
  • An attacker could execute arbitrary Python code with the process user's privileges.
  • A compromised process could expose credentials or enable further movement within the environment.

General mitigation guidance

Mitigation generally focuses on enforcing the intended directory boundary at

the point where paths are resolved and before any filesystem or execution

operation occurs.

Common defensive patterns include:

  • Resolve candidate paths canonically and verify they remain beneath the approved root.
  • Prefer opaque file identifiers or allowlisted relative paths over unrestricted path input.
  • Reject traversal, absolute paths, symlink escapes, and ambiguous path representations.
  • Keep file-reading, file-writing, and code-execution capabilities separate and disabled by default where possible.
  • Apply least-privilege identities, filesystem permissions, and sandboxing to the tool process.
  • Treat agent-generated arguments and prompt-derived values as untrusted input.
  • Limit writable locations and avoid placing credentials or sensitive files within reachable directories.

How teams detect issues like this

Organizations can look for path traversal risks through:

  • Static analysis rules identifying concatenation or joining of user-controlled paths without canonical boundary checks.
  • Code review checks for missing validation after path normalization, including symlink and absolute-path handling.
  • Tests that verify file operations cannot escape approved directories under varied path representations.
  • Runtime monitoring for unusual access to system files, unexpected writes, or execution of newly created scripts.
  • Policy enforcement requiring explicit allowlists and security review for agent tools with filesystem access.

Automated code review and software composition analysis tools may help identify unsafe path-handling patterns, but should be supplemented with behavioral testing.

Sources

SourceLink
github.comgithub.com/agno-agi/agno
github.comgithub.com/agno-agi/agno/commit/710d7e7f846f93b7a3eadfd3e77075428c39e803
vulncheck.comvulncheck.com/advisories/agno-pythontools-path-traversal-via-joinpath-file-name-argument

Frequently asked

questions

It can be remotely exploitable when the affected tools are exposed through an

application, agent service, or API that accepts attacker-controlled requests

or content. The practical scope depends on authentication, network exposure,

and tool permissions.

An attacker generally needs the ability to invoke the PythonTools actions or

influence an agent sufficiently for it to pass a controlled file name to

those actions. The resulting impact is limited by the operating-system

permissions of the process.

Resolve and validate every requested path against a canonical, approved root

before performing any operation. Use allowlisted file references and disable

execution-capable tools unless they are explicitly required.

Treat all agent-generated and user-supplied paths as untrusted, test boundary

enforcement including symlink cases, apply least privilege, and monitor

filesystem access and tool invocations.

Find out what's already
exploitable in your codebase.