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

