Anthropic Filesystem MCP Server: Directory Access Bypass via Improper Path Validation
The filesystem MCP server from Anthropic is meant to restrict an AI client to a configured list of allowed directories, but its path validation was improper, so the allowlist could be bypassed. An attacker able to influence the AI client could then reach files outside the intended directories.
embracethered.com
Published on embracethered.com
A few months ago I was looking at the filesystem MCP server from Anthropic.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An AI client configured with an allowlist could be made to read or edit files outside the allowed directories, though the text does not show a full exploit.
What the attacker needed
Filesystem MCP server in use; allowedDirectories configured; attacker can influence the AI client
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This tool lets an AI assistant read and edit files on your computer, and it is supposed to be limited to folders you list as allowed. The report says that limit could be got around, so the assistant could reach files in other folders. That matters because the AI can be steered by content it reads, so a bad instruction could turn into access to private files.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.