54yyyu code-mcp Path Traversal Vulnerability (CVE-2026-7811)
A path traversal vulnerability exists in the is_safe_path function of the MCP File Handler component in 54yyyu code-mcp, allowing remote attackers to access sensitive files.
A path traversal vulnerability, identified as CVE-2026-7811, has been discovered in 54yyyu code-mcp, affecting versions up to commit 4cfc4643541a110c906d93635b391bf7e357f4a8. This flaw resides within the is_safe_path function in src/code_mcp/server.py, a part of the MCP File Handler component. The vulnerability enables remote attackers to bypass security restrictions and potentially access unauthorized files and directories on the server. The exploit is publicly known. The vendor employs rolling releases, making specific version details unavailable, and has not yet responded to the initial vulnerability report. This lack of response and public exploit availability poses a significant risk to systems running the affected code-mcp versions.
Attack Chain
- The attacker identifies a vulnerable instance of 54yyyu code-mcp running a version with the affected
is_safe_pathfunction. - The attacker crafts a malicious HTTP request targeting the MCP File Handler, specifically designed to invoke the vulnerable
is_safe_pathfunction. - The crafted request includes a path containing directory traversal sequences (e.g.,
../) intended to bypass the path validation logic. - The
is_safe_pathfunction fails to properly sanitize the input path, allowing the traversal sequences to be processed. - The application attempts to access a file or directory outside of the intended base directory based on the attacker-controlled path.
- The server reads the contents of the file or directory and includes it in the HTTP response.
- The attacker receives the sensitive information, such as configuration files or source code.
- The attacker can then use this information to further compromise the system or network.
Impact
Successful exploitation of this path traversal vulnerability can allow attackers to read sensitive files from the server hosting the 54yyyu code-mcp application. This may include configuration files, source code, or other data that could aid in further attacks, such as privilege escalation or lateral movement. Since the exploit is publicly available, unpatched systems are at immediate risk of compromise. The number of affected installations and the specific sectors impacted are currently unknown, but the potential for data breaches and system compromise is significant.
Recommendation
- Deploy the Sigma rule
Detect Code-mcp Path Traversal Attemptto identify requests containing suspicious path traversal sequences in thecs-uri-queryfield of web server logs. - Enable web server logging to capture HTTP requests and responses, which is required for the Sigma rule to function correctly (logsource:
webserver). - Since specific patched versions are unavailable due to the rolling release model, monitor the vendor’s code repository for updates to the
is_safe_pathfunction insrc/code_mcp/server.pyand deploy the updated code as soon as it becomes available. - Implement a web application firewall (WAF) rule to block requests containing path traversal sequences like
../in URL parameters to mitigate the risk proactively.
Detection coverage 2
Detect Code-mcp Path Traversal Attempt
highDetects attempts to exploit the path traversal vulnerability in 54yyyu code-mcp by identifying requests containing common path traversal sequences.
Detect Code-mcp Server.py Access with Traversal
highDetects access to server.py with directory traversal
Detection queries are kept inside the platform. Get full rules →