CVE-2026-7272 Overview
A path traversal vulnerability has been identified in WilliamCloudQi matlab-mcp-server affecting versions up to commit ab88f6b9bf5f36f725e8628029f7f6dd0d9913ca. The vulnerability exists within the generate_matlab_code/execute_matlab_code functions in the src/index.ts file of the MCP Interface component. By manipulating the scriptPath argument, an attacker can traverse directory paths and potentially access or execute files outside the intended directory scope.
Critical Impact
Remote attackers can exploit the path traversal vulnerability to access files outside the intended directory, potentially leading to information disclosure or unauthorized code execution through the MCP Interface.
Affected Products
- WilliamCloudQi matlab-mcp-server up to commit ab88f6b9bf5f36f725e8628029f7f6dd0d9913ca
Discovery Timeline
- 2026-04-28 - CVE CVE-2026-7272 published to NVD
- 2026-04-29 - Last updated in NVD database
Technical Details for CVE-2026-7272
Vulnerability Analysis
This path traversal vulnerability (CWE-22) affects the MCP (Model Context Protocol) Interface component of the matlab-mcp-server project. The vulnerability allows remote attackers to bypass intended path restrictions by injecting directory traversal sequences (such as ../) into the scriptPath parameter. When the vulnerable functions generate_matlab_code or execute_matlab_code in src/index.ts process user-supplied input without proper validation, attackers can reference files and directories outside the application's root directory.
The MCP Interface is designed to facilitate interaction between MATLAB and external systems, making it a critical component. The lack of proper input sanitization on the scriptPath argument means that any user with network access to the service can potentially read arbitrary files from the server or execute MATLAB scripts from unintended locations. An exploit for this vulnerability has been published and may be actively used.
Root Cause
The root cause of this vulnerability lies in insufficient input validation and sanitization of the scriptPath parameter within the generate_matlab_code and execute_matlab_code functions. The application fails to properly canonicalize or validate the supplied path, allowing directory traversal sequences to be processed. This design flaw enables attackers to escape the intended working directory by using relative path components like ../ to navigate the file system hierarchy.
Attack Vector
The attack can be executed remotely over the network without requiring authentication or user interaction. An attacker sends a crafted request to the MCP Interface with a malicious scriptPath parameter containing directory traversal sequences. The vulnerable endpoint processes this input and may access or execute files outside the intended directory structure.
For example, an attacker could supply a path like ../../etc/passwd or ../../sensitive/script.m to access files outside the intended MATLAB scripts directory. The vulnerability mechanism involves manipulating the path argument to traverse parent directories and reach arbitrary locations on the file system. Technical details and proof-of-concept information can be found in the GitHub Issue Report.
Detection Methods for CVE-2026-7272
Indicators of Compromise
- HTTP requests to the MCP Interface containing path traversal sequences such as ../, ..%2f, or %2e%2e/ in the scriptPath parameter
- Unusual file access attempts in application logs referencing directories outside the MATLAB scripts root
- Error messages indicating file not found or access denied for paths that should not be accessible through the interface
Detection Strategies
- Implement web application firewall (WAF) rules to detect and block requests containing directory traversal patterns in URL parameters
- Monitor application logs for anomalous path references, particularly those containing .. sequences or attempting to access system files
- Deploy SentinelOne endpoint detection to identify suspicious file system access patterns originating from the matlab-mcp-server process
Monitoring Recommendations
- Enable detailed logging for the MCP Interface component to capture all incoming requests and their parameters
- Set up alerts for any requests to the vulnerable endpoints that contain path manipulation characters
- Monitor file system access by the matlab-mcp-server process for reads or executions outside designated directories
How to Mitigate CVE-2026-7272
Immediate Actions Required
- Disable or restrict network access to the matlab-mcp-server MCP Interface until a patch is available
- Implement network segmentation to limit access to the affected service from untrusted networks
- Review and audit access logs for any evidence of exploitation attempts
Patch Information
At the time of publication, the project maintainers have been informed of the vulnerability through an issue report but have not yet responded. Users should monitor the matlab-mcp-server GitHub repository for updates and security patches. Additional details are available in the VulDB Vulnerability Listing.
Workarounds
- Implement a reverse proxy with path filtering to reject requests containing directory traversal sequences before they reach the application
- Apply file system permissions to restrict the matlab-mcp-server process to only access necessary directories
- Consider running the service in a containerized or sandboxed environment to limit the impact of successful exploitation
# Example: Using nginx as a reverse proxy to filter malicious paths
# Add to nginx server configuration
location /mcp {
if ($request_uri ~* "\.\.") {
return 403;
}
proxy_pass http://localhost:3000;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


