A folder named allow_dir_evil passed the check. How the Filesystem MCP server got out of its allowed directory Cymulate researcher Elad Beber found two path-traversal flaws in Anthropic's reference Filesystem MCP server that let an agent escape its allowed directory without a memory bug: a startsWith() prefix check that accepted sibling folders like allow_dir_evil (CVE-2025-53110), and a catch block that swallowed the symlink-escape error and returned the link's own path (CVE-2025-53109). Both were fixed on 1 July 2025 in version 2025.7.1, which compares against the directory plus a separator, catches only ENOENT, and writes files with the wx flag plus a temp-file rename so symlinks are replaced rather than followed. Cymulate chained the two to read /etc/sudoers and, on macOS, write a LaunchAgents plist for code execution at next login. The Filesystem MCP server is usually the first one people add. You give it a folder, and the agent can read and write inside that folder and nowhere else. In a web3 dev setup it matters more than most, because it runs as your user, and your user can read ~/.foundry/keystores and ~/.ssh . In March 2025 Elad Beber at Cymulate found two ways out of that folder in Anthropic's reference server, the one in the modelcontextprotocol/servers repo. Both were fixed on 1 July 2025 in version 2025.7.1 and published as CVE-2025-53110 and CVE-2025-53109, which Cymulate calls EscapeRoute Cymulate's write-up https://cymulate.com/blog/cve-2025-53109-53110-escaperoute-anthropic/ . Neither needed a memory bug. One was a startsWith , the other a catch block. This was the containment check before the fix: js const isAllowed = allowedDirectories.some dir = normalizedRequested.startsWith dir ; With /private/tmp/allow dir allowed, /private/tmp/allow dir evil starts with the same string, so it passes. So does any sibling whose name extends the allowed one: project-old next to project , app.bak next to app . That's CVE-2025-53110. ../ doesn't get you out here. The server runs path.resolve on the request before the check, so allow dir/../../etc/passwd becomes /etc/passwd and fails. The way out is a sibling with a longer name. The fix compares against the directory plus a separator, so the request has to start with /private/tmp/allow dir/ or be the directory itself commit d00c60d https://github.com/modelcontextprotocol/servers/commit/d00c60df9d74dba8a3bb13113f8904407cda594f . The server did resolve symlinks. After the prefix check it ran fs.realpath and checked the real path too. The problem was the error handling around it trimmed : js try { const realPath = await fs.realpath absolute ; if allowedDirectories.some dir = normalizePath realPath .startsWith dir { throw new Error "Access denied - symlink target outside allowed directories" ; } return realPath; } catch error { // For new files that don't exist yet, verify parent directory const parentDir = path.dirname absolute ; // ...realpath parentDir passes the prefix check... return absolute; } The catch was meant for files that don't exist yet. It caught every error, including the "symlink target outside" one thrown a few lines up. Then it checked the symlink's parent, which sits inside the allowed folder, and returned the symlink's own path. The tool then read or wrote through the link to wherever it pointed. That's CVE-2025-53109. Cymulate chained the two: create allow dir evil passes the prefix check , put test - /etc/sudoers inside it, and ask the agent to read it. For code execution on macOS they pointed a symlink at a plist in ~/Library/LaunchAgents and had the server write it, so their command ran at the next login. The July 2025 fix catches only ENOENT and rethrows anything else. write file started creating files with the wx flag, which fails if anything, a symlink included, already sits at that name, and otherwise wrote a temp file and renamed it over the name. A rename replaces the link instead of following it. The server has no tool that creates a symlink. In Cymulate's demo a second local user made it in /private/tmp . On a developer machine the likelier source is whatever else writes into the folder you shared. Git checks out symlinks as real symlinks by default on macOS and Linux, and archives can carry them too. So on a version before 2025.7.1, if the allowed folder was a repo you cloned, the repo's author had a say in where the agent could reach. I wrote more about cloned repos in Your repo is not trusted context https://dev.to/bloqarl/your-repo-is-not-trusted-context-what-i-changed-after-giving-coding-agents-real-repositories-2ken . GitHub's advisories rate both CVEs 7.3 on CVSS 4.0, and Cymulate scored the symlink one 8.4. The number matters less than who the server runs as. It runs as you, so once the boundary fails it reaches what you can. In October and November 2026 the same server got seven more advisories https://github.com/modelcontextprotocol/servers/security/advisories . Two repeat the 2025 mistake, a check run on one string and the operation on another: /allowed/proj' , a sibling of /allowed/proj , passed. Fixed in 2.0.1. realpath , and new files went through the link to outside the folder. Fixed in 2.0.1. Four are races. The server checked the resolved path and then used the path again by name, so a directory swapped for a symlink in between redirected the call. They hit the new-file fallback above GHSA-53mr-w429-c597 https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-53mr-w429-c597 , writes, fixed in 2.0.1 , the source of move file GHSA-7m4x-rv66-mxhh https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-7m4x-rv66-mxhh , fixed in 2.3.0 , read text file GHSA-p9cv-8g75-4xcg https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-p9cv-8g75-4xcg , fixed in 2.3.0 and the listing tools GHSA-rq2p-q7c4-6g27 https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-rq2p-q7c4-6g27 , fixed in 2.4.0 . Each needs a local process that can rename things inside the allowed folder while the server runs. The last one needs less. list directory with sizes ran stat on every entry, which follows symlinks, so a symlink already in the folder, like one that came with a cloned repo, leaked the size of a file outside it GHSA-hhwq-wxfx-cj7g https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-hhwq-wxfx-cj7g , fixed in 2.0.1 . Since 2.4.0, on Linux and macOS, the server anchors reads, writes and listings to the directory it validated. Its README says it can't do that on Windows, where a process that can write in the folder can still win the race on a parent directory. The package used date versions up to 2026.8.31 and then moved to plain version numbers. The 2026 advisories list no fix for the date line. And 2.4.1 is a lower version number than 2026.8.31, so a lockfile, an exact date pin or a ^2026.8.31 range never moves to it, and npm update won't either. If your client config or lockfile has a date version, change it by hand and pin the new one: "args": "-y", "@modelcontextprotocol/server-filesystem@2.4.1", "/Users/me/code/my-project" --confine-roots 2.2.0 and later . The server logs the effective directories to stderr at startup and on every change, so read that line once. /tmp and a repo you just cloned both have other writers. A folder only you and the agent write to removes the setup every one of these bugs needed. node modules from its store. get file info reports a hardLinks count, and more than 1 means the file has other names. --read-only drops every write tool, and --read-only-dir