CVE-2025-68145: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in modelcontextprotocol servers
In mcp-server-git versions prior to 2025.12.17, when the server is started with the --repository flag to restrict operations to a specific repository path, it did not validate that repo_path arguments in subsequent tool calls were actually within that configured path. This could allow tool calls to operate on other repositories accessible to the server process. The fix adds path validation that resolves both the configured repository and the requested path (following symlinks) and verifies the requested path is within the allowed repository before executing any git operations. Users are advised to upgrade to 2025.12.17 upon release to remediate this issue.
AI Analysis
Technical Summary
CVE-2025-68145 is a path traversal vulnerability classified under CWE-22 affecting modelcontextprotocol (mcp) servers before version 2025.12.17. The mcp server can be started with the --repository flag to restrict git operations to a specific repository path, intended to prevent unauthorized access to other repositories on the server. However, the server did not validate that repo_path arguments provided in subsequent tool calls were actually within the configured repository path. This lack of validation allows an attacker to craft tool calls with repo_path parameters that traverse directories outside the restricted repository, potentially accessing or modifying other repositories accessible to the server process. The vulnerability arises because the server failed to resolve and verify the requested paths, including following symbolic links, against the configured repository path before executing git operations. The fix implemented in version 2025.12.17 adds robust path validation that resolves both the configured repository path and the requested repo_path, ensuring the requested path is strictly within the allowed repository boundary. The CVSS 4.0 score is 6.4 (medium severity), reflecting that the vulnerability can be exploited remotely without authentication or privileges but requires user interaction to trigger the vulnerable tool calls. No known exploits are currently reported in the wild. This vulnerability could lead to unauthorized access or modification of git repositories beyond the intended scope, potentially exposing sensitive source code or disrupting development workflows.
Potential Impact
For European organizations, this vulnerability poses a risk of unauthorized access and manipulation of source code repositories managed by mcp servers. Organizations relying on mcp servers to enforce repository access restrictions could have these controls bypassed, leading to potential intellectual property theft, code tampering, or supply chain risks if malicious code is injected. The impact is particularly significant for software development companies, technology firms, and any enterprise using mcp servers to manage critical codebases. Unauthorized repository access could also lead to exposure of sensitive information contained in code or configuration files. Additionally, disruption of repository integrity could affect development pipelines and product releases. Given the medium severity and the lack of authentication requirements, attackers with network access to the mcp server could exploit this vulnerability, increasing the risk profile for organizations with exposed or poorly segmented internal networks.
Mitigation Recommendations
European organizations should immediately plan and execute an upgrade to modelcontextprotocol server version 2025.12.17 or later, which includes the patch that enforces strict path validation and symlink resolution. Until the upgrade is applied, organizations should restrict network access to mcp servers to trusted users and networks only, using firewalls and network segmentation to limit exposure. Monitoring and logging of git operations on mcp servers should be enhanced to detect unusual repository access patterns that may indicate exploitation attempts. Implementing strict access controls and auditing on the underlying filesystem and repositories can reduce the impact of unauthorized access. Additionally, organizations should review and harden the configuration of mcp servers, avoiding unnecessary use of the --repository flag if not required, and validating all inputs in custom tooling that interacts with mcp servers. Regular vulnerability scanning and penetration testing focusing on repository access controls can help identify residual risks.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Ireland
CVE-2025-68145: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in modelcontextprotocol servers
Description
In mcp-server-git versions prior to 2025.12.17, when the server is started with the --repository flag to restrict operations to a specific repository path, it did not validate that repo_path arguments in subsequent tool calls were actually within that configured path. This could allow tool calls to operate on other repositories accessible to the server process. The fix adds path validation that resolves both the configured repository and the requested path (following symlinks) and verifies the requested path is within the allowed repository before executing any git operations. Users are advised to upgrade to 2025.12.17 upon release to remediate this issue.
AI-Powered Analysis
Technical Analysis
CVE-2025-68145 is a path traversal vulnerability classified under CWE-22 affecting modelcontextprotocol (mcp) servers before version 2025.12.17. The mcp server can be started with the --repository flag to restrict git operations to a specific repository path, intended to prevent unauthorized access to other repositories on the server. However, the server did not validate that repo_path arguments provided in subsequent tool calls were actually within the configured repository path. This lack of validation allows an attacker to craft tool calls with repo_path parameters that traverse directories outside the restricted repository, potentially accessing or modifying other repositories accessible to the server process. The vulnerability arises because the server failed to resolve and verify the requested paths, including following symbolic links, against the configured repository path before executing git operations. The fix implemented in version 2025.12.17 adds robust path validation that resolves both the configured repository path and the requested repo_path, ensuring the requested path is strictly within the allowed repository boundary. The CVSS 4.0 score is 6.4 (medium severity), reflecting that the vulnerability can be exploited remotely without authentication or privileges but requires user interaction to trigger the vulnerable tool calls. No known exploits are currently reported in the wild. This vulnerability could lead to unauthorized access or modification of git repositories beyond the intended scope, potentially exposing sensitive source code or disrupting development workflows.
Potential Impact
For European organizations, this vulnerability poses a risk of unauthorized access and manipulation of source code repositories managed by mcp servers. Organizations relying on mcp servers to enforce repository access restrictions could have these controls bypassed, leading to potential intellectual property theft, code tampering, or supply chain risks if malicious code is injected. The impact is particularly significant for software development companies, technology firms, and any enterprise using mcp servers to manage critical codebases. Unauthorized repository access could also lead to exposure of sensitive information contained in code or configuration files. Additionally, disruption of repository integrity could affect development pipelines and product releases. Given the medium severity and the lack of authentication requirements, attackers with network access to the mcp server could exploit this vulnerability, increasing the risk profile for organizations with exposed or poorly segmented internal networks.
Mitigation Recommendations
European organizations should immediately plan and execute an upgrade to modelcontextprotocol server version 2025.12.17 or later, which includes the patch that enforces strict path validation and symlink resolution. Until the upgrade is applied, organizations should restrict network access to mcp servers to trusted users and networks only, using firewalls and network segmentation to limit exposure. Monitoring and logging of git operations on mcp servers should be enhanced to detect unusual repository access patterns that may indicate exploitation attempts. Implementing strict access controls and auditing on the underlying filesystem and repositories can reduce the impact of unauthorized access. Additionally, organizations should review and harden the configuration of mcp servers, avoiding unnecessary use of the --repository flag if not required, and validating all inputs in custom tooling that interacts with mcp servers. Regular vulnerability scanning and penetration testing focusing on repository access controls can help identify residual risks.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-12-15T19:06:04.108Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69432efa058703ef3fc97f3f
Added to database: 12/17/2025, 10:30:18 PM
Last enriched: 12/17/2025, 11:25:37 PM
Last updated: 12/18/2025, 12:49:36 PM
Views: 8
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-14618: CWE-862 Missing Authorization in listingthemes Sweet Energy Efficiency
MediumCVE-2025-14437: CWE-532 Insertion of Sensitive Information into Log File in wpmudev Hummingbird Performance – Cache & Page Speed Optimization for Core Web Vitals | Critical CSS | Minify CSS | Defer CSS Javascript | CDN
HighCVE-2025-14277: CWE-918 Server-Side Request Forgery (SSRF) in bdthemes Prime Slider – Addons for Elementor
MediumCVE-2025-13110: CWE-639 Authorization Bypass Through User-Controlled Key in realmag777 HUSKY – Products Filter Professional for WooCommerce
MediumCVE-2025-10910: CWE-639 Authorization Bypass Through User-Controlled Key in Govee H6056
CriticalActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.