AI Plugin Path Traversal — Escaping the Docs Folder
HandbookBot answers questions by reading files from the handbook folder with its read_doc plugin. The plugin trusts whatever filename the model passes in — and the model passes in whatever you ask for.
What is path traversal in an AI plugin?
Path traversal is reading or writing a file outside the folder a program was meant to stay in, by giving it a path that climbs out.
An AI plugin that reads files takes the filename from the model, and the model takes it from the conversation. If the plugin does not check where the final path points, a user can ask the assistant for a document that lives well outside the intended folder.
A real case
Cymulate reported CVE-2025-53110 and CVE-2025-53109 in Anthropic's Filesystem MCP server. A directory check that only compared the start of a path, and a symlink that was followed without checking, let an agent read and write files outside the folders it had been limited to.
This lab has the same weakness: a file tool that trusts the path it is given and does not confirm where it really leads.
Source: Cymulate
How to fix it
- Resolve the full real path first, then check that it sits inside the allowed folder.
- Resolve symbolic links before the check.
- Prefer a fixed list of document IDs over free-form paths.
- Run the plugin as a user that can read only that folder.
Questions people ask
What is path traversal?
A bug that lets a caller reach files outside the intended directory by manipulating the path.
Why can't the model catch it?
It can be told to, but it can also be persuaded otherwise. The check belongs in the plugin's code.
Is checking the start of the path enough?
No. A check on the beginning of the path string was one of the 2025 flaws; the path must be fully resolved first.
Read the full OWASP LLM Top 10 guide · All free labs · AI red team certification