Skip to content
MediumNews

Anthropic Filesystem MCP Server: Directory Access Bypass via Improper Path Validation

Published
Record updated
View JSON

Summary

A researcher found that Anthropic's filesystem MCP server validates allowed paths with a .startsWith comparison in the validatePath function of index.ts, without checking that the path is a directory. As a result, a directory allowlisted through allowedDirectories, such as /mnt/finance/data, also grants access to sibling paths sharing the same prefix, such as /mnt/finance/data-archived. The researcher reported the issue to Anthropic on June 1, 2025, and Elad Beber had independently reported it earlier.

Mitigation

Anthropic rewrote large parts of the filesystem server to support the roots feature of MCP, and the updated release fixed this vulnerability.