CVE-2026-7400
Path Traversal in filesystem-mcp-server
Publication date: 2026-04-29
Last updated on: 2026-04-29
Assigner: VulDB
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| geekgod382 | filesystem-mcp-server | 1.0.0 |
| geekgod382 | filesystem-mcp-server | 1.1.0 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-22 | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the geekgod382 filesystem-mcp-server version 1.0.0, specifically in the is_path_allowed function within the server.py file of the read_file_tool/write_file_tool component.
The issue allows an attacker to perform a path traversal attack, which means they can manipulate file paths to access files and directories outside the intended scope.
The attack can be launched remotely without any authentication, making it easier for attackers to exploit.
Upgrading to version 1.1.0 of the software addresses this vulnerability.
How can this vulnerability impact me? :
This vulnerability can allow an attacker to access unauthorized files on the server by exploiting the path traversal flaw.
Such unauthorized access can lead to exposure of sensitive information, data leakage, or modification of files.
Since the attack can be performed remotely without authentication, it increases the risk of compromise.
What immediate steps should I take to mitigate this vulnerability?
The immediate step to mitigate this vulnerability is to upgrade the affected component, geekgod382 filesystem-mcp-server, from version 1.0.0 to version 1.1.0.
This upgrade includes a patch (commit 45364545fc60dc80aadcd4379f08042d3d3d292e) that addresses the path traversal issue in the is_path_allowed function of server.py.
Can you explain this vulnerability to me?
This vulnerability exists in the filesystem-mcp-server version 1.0.0, specifically in the is_path_allowed function used by file operations like read_file_tool and write_file_tool. The function attempts to restrict file access to certain allowed directories by checking if a requested path starts with an allowed prefix. However, this check is flawed because it only compares string prefixes, allowing an attacker to craft paths that appear to be within allowed directories but actually point outside them.
For example, if the allowed path is /home/alice, an attacker could use a path like /home/alice_backup/loot.txt, which starts with the allowed prefix but is outside the intended directory. This bypass enables unauthorized access to files and directories outside the allowed scope.
The vulnerability can be exploited remotely and affects multiple file operations including reading, writing, deleting, moving, copying, and directory listing. The issue was fixed in version 1.1.0 by improving the path validation logic to properly verify that paths are truly within allowed directories.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability in the filesystem-mcp-server allows an attacker to bypass path restrictions and perform unauthorized file operations such as reading, writing, or deleting files outside the intended allowed directories.
This unauthorized access to files can lead to exposure or modification of sensitive data, which poses significant risks to confidentiality and integrity.
Such risks can directly impact compliance with data protection standards and regulations like GDPR and HIPAA, which require strict controls over access to personal and sensitive information.
Failure to prevent unauthorized data access or modification could result in violations of these regulations, potentially leading to legal penalties, reputational damage, and loss of trust.
Therefore, this vulnerability undermines the ability of organizations using the affected software to maintain compliance with common security and privacy standards.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by testing whether the filesystem-mcp-server improperly allows access to paths that share a prefix with allowed directories but are actually outside those directories. Specifically, you can attempt to access or manipulate files using crafted paths that exploit the prefix-check bypass in the is_path_allowed function.
For example, if the server's ALLOWED_PATHS includes /home/alice, you can try to read, write, or delete files in /home/alice_backup or other similarly prefixed directories to see if the server improperly permits these operations.
Suggested commands to test this behavior might include sending requests to the server's read_file_tool or write_file_tool with paths like /home/alice_backup/test.txt and observing if the operation succeeds.
Since the server is Python-based and uses an API for file operations, you can use curl or similar HTTP clients to send crafted requests. For example:
- curl -X POST http://<server_address>/write_file_tool -d '{"path": "/home/alice_backup/test.txt", "content": "test"}'
- curl -X POST http://<server_address>/read_file_tool -d '{"path": "/home/alice_backup/test.txt"}'
If these commands succeed in accessing or modifying files outside the intended allowed paths, the vulnerability is present.
What immediate steps should I take to mitigate this vulnerability?
The immediate recommended step to mitigate this vulnerability is to upgrade the filesystem-mcp-server to version 1.1.0, which includes a patch that fixes the ALLOWED_PATHS check bypass.
Additionally, restricting access to trusted callers and enforcing stricter path validation by canonicalizing paths and ensuring they are truly within the allowed directories can help mitigate the risk.
- Upgrade to filesystem-mcp-server version 1.1.0.
- Apply the patch identified by commit 45364545fc60dc80aadcd4379f08042d3d3d292e if upgrading is not immediately possible.
- Implement stricter path validation to ensure paths are canonicalized and verified to be within allowed directories.
- Restrict server access to trusted users or systems to reduce exposure.
How can this vulnerability impact me? :
This vulnerability can have serious security impacts because it allows an attacker to bypass directory restrictions and perform unauthorized file operations.
- Read sensitive files outside the allowed directories, potentially exposing confidential information.
- Write or modify files in unauthorized locations, which could lead to data corruption or insertion of malicious content.
- Delete important files outside the allowed paths, causing data loss or disruption of services.
- Perform other file system operations like moving or copying files outside the intended scope.
Because the exploit can be launched remotely without authentication, it poses a high risk to systems using the vulnerable version of the filesystem-mcp-server.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by testing if the filesystem-mcp-server improperly allows access to paths that share a prefix with allowed directories but are outside the intended boundaries. Specifically, attempts to read, write, or delete files in directories that are not truly within the configured ALLOWED_PATHS but have similar prefixes can indicate the presence of the vulnerability.
For example, if the allowed path is /home/alice, you can try to access /home/alice_backup/loot.txt or write a file to /home/alice_backup/codex-poc.txt. If these operations succeed, the vulnerability is present.
Commands to test this might include using the write_file_tool or read_file_tool interfaces of the server to attempt file operations on such crafted paths.
- Attempt to read a file outside the allowed directory but with a similar prefix, e.g., /home/alice_backup/loot.txt.
- Attempt to write a file to a path like /home/alice_backup/codex-poc.txt using the write_file_tool.
- Monitor server logs or network traffic for requests that include paths with prefix similarities to allowed paths but are outside the intended directories.