/

CVE-2026-51853

Severity:

HIGH RISK

(7.5)

Directory Traversal (CWE-22) in agent-zero FileBrowser

CVE-2026-51853

Deferred

Vulnerability type

Category:

Directory Traversal

CWE:

CWE-22

Impact:

Unauthorized File Access

Severity:

HIGH RISK

(7.5)

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

agent-zero's FileBrowser initializes its workspace from the host root directory, allowing file access beyond the intended application workspace. If the agent or a user can request file-browser operations, this weakness may expose or enable modification of files outside the permitted directory.

Affected context

The vulnerability occurs in deployments using the affected agent-zero FileBrowser implementation when the workspace is initialized from the host root rather than a restricted application directory. Risk depends on whether an attacker or untrusted agent interaction can invoke file browsing and whether the process identity has access to sensitive host files.

Exploit preconditions

  • Attack surface: File-browser operations exposed through the agent or its associated interface
  • Required access: Ability to interact with the agent or invoke FileBrowser functionality
  • Trigger point: File access requests handled after the workspace is initialized
  • Why exploitation is possible: The configured workspace begins at the host root and lacks an effective confinement boundary, allowing path resolution to reach unintended system locations

Why this happens

The underlying bug is an improper restriction of filesystem paths. The FileBrowser class treats the host root directory as its workspace without enforcing a trusted base directory or verifying that resolved paths remain within an allowed subtree. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as directory traversal.

Potential impact

  • Sensitive system, application, or credential files may be disclosed
  • Files outside the intended workspace could be modified or deleted
  • Agent secrets, configuration data, or source code could be exposed
  • System integrity may be affected if the process has sufficient permissions
  • The exposed information could support further compromise

General mitigation guidance

Mitigation generally focuses on enforcing a narrow filesystem trust boundary and treating requested paths as untrusted input.

Common defensive patterns include:

  • Use an explicitly configured, dedicated workspace rather than the host root
  • Resolve and canonicalize paths before access, then verify they remain within the approved directory
  • Reject absolute paths, traversal components, and symlink escapes where appropriate
  • Apply allowlists for accessible files and operations
  • Run the agent with a dedicated low-privilege operating-system identity
  • Use container, sandbox, or read-only filesystem controls to limit host exposure
  • Avoid exposing sensitive host directories to the agent runtime

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying filesystem access built from user-controlled paths
  • Code review checks for missing canonicalization and base-directory containment validation
  • Tests that exercise absolute paths, traversal components, symbolic links, and nested paths
  • Runtime telemetry for file operations outside the expected workspace
  • Policy enforcement requiring dedicated workspaces and least-privilege filesystem permissions
  • Automated security review tools that flag unrestricted path joins or root-directory initialization

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/4fe09fc7f94c9c0b10c8b6198a70e920
github.comgithub.com/agent0ai/agent-zero/issues/1539

Frequently asked

questions

Exploitability depends on how agent-zero is deployed and exposed. It may be reachable remotely when an untrusted user or external service can invoke the affected file-browser functionality.

An attacker generally needs the ability to interact with the agent or trigger FileBrowser operations. The files that can be reached also depend on the operating-system permissions of the agent process.

Restrict the workspace to a dedicated directory, canonicalize requested paths, and enforce that every resolved path remains inside the approved directory.

Combine path-containment tests with least-privilege process accounts, sandboxing, restricted filesystem mounts, and code-review policies for filesystem access.

Find out what's already
exploitable in your codebase.