> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flintai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Path traversal in file tools

> File read/write tools accept paths without sanitization, enabling directory traversal

File read/write tools accept paths without sanitization, enabling directory traversal

## How to resolve

Restrict file paths to a sandbox directory using Path.resolve() and startswith() validation. Reject paths containing '..' or absolute paths outside the allowed root.

## Risk

**Governance/Compliance**

This vulnerability falls under [ASI02:2026 — Tool Misuse and Exploitation](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/) in the OWASP Top 10 for Agentic Applications. Agent uses legitimate tools in unsafe ways due to over-privilege, bad input, or poisoned descriptors.

**Security**

File read/write tools accept paths without sanitization, enabling directory traversal. If exploited, this can compromise the agent's integrity, confidentiality, or availability, potentially affecting downstream systems and data.

## Explanation

File read/write tools accept paths without sanitization, enabling directory traversal. This falls under ASI02 (Tool Misuse and Exploitation): Agent uses legitimate tools in unsafe ways due to over-privilege, bad input, or poisoned descriptors.

## Specifications

**Trigger**

* Agent scan detects file read/write tools accept paths without sanitization, enabling directory traversal

The scanner looks for patterns such as:

* FileReadTool or FileWriteTool with no path restriction
* open(path) with path derived from LLM output
* no path.resolve() or os.path.abspath() sanitization

**Severity**

* HIGH

**Applies to**: Agent
