Skip to main content
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 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