CVE-2026-27735: mcp-server-git Path Traversal Vulnerability Allows Staging of Files Outside Repository
Summary
CVE-2026-27735: mcp-server-git : Path traversal in git_add allows staging files outside repository boundaries. Affects mcp-server-git versions < 2026.1.14. Fixed in 2026.1.14. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
mcp-server-git is a tool designed for managing Git repositories, enabling users to perform various Git operations programmatically. It leverages GitPython to interact with Git repositories, allowing for seamless integration into Python applications. However, prior to version 2026.1.14, the tool lacked proper validation of file paths, making it susceptible to path traversal attacks.
Vulnerability Detail
The vulnerability in mcp-server-git arises from the git_add tool's failure to validate file paths provided in the files argument. This oversight allows relative paths containing '..' sequences to be accepted, potentially staging files outside the intended repository boundaries. Consequently, sensitive files could be inadvertently committed and pushed to remote repositories, leading to data exfiltration. The root cause lies in the use of GitPython's repo.index.add(), which does not enforce working-tree boundary checks for relative paths.
How To Fix
Minimum fixed version
2026.1.14
This is the first release that contains the fix.
pip install --upgrade "mcp-server-git==2026.1.14"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can manually validate file paths before passing them to the git_add tool to ensure they remain within the repository boundaries. This can be done by checking if the resolved path is a subdirectory of the repository's root.
Conclusion
The path traversal vulnerability in mcp-server-git allows for the staging of files outside repository boundaries, posing a risk of sensitive data exposure. Users are strongly advised to upgrade to version 2026.1.14 or newer to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor for such vulnerabilities in open-source dependencies.
See every vulnerability recorded for mcp-server-git →
FAQ
The CVSS score of this vulnerability is 6.4, indicating a moderate severity level.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
If exploited, this vulnerability could lead to the unintentional staging and committing of sensitive files, resulting in data leaks.
Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software by analyzing the Pipfile.lock.
If an immediate upgrade is not possible, ensure to validate file paths manually to prevent staging files outside the repository boundaries.
References
Related vulnerabilities
Recent vulnerabilities recorded for mcp-server-git.