CVE-2026-27735: mcp-server-git Path Traversal Vulnerability Allows Staging Files Outside Repository Boundaries
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, allowing users to perform various Git operations programmatically. It leverages GitPython to interact with Git repositories, enabling functionalities such as adding files, committing changes, and pushing updates. However, prior to version 2026.1.14, mcp-server-git had a critical vulnerability that allowed users to stage files outside the intended repository boundaries, potentially leading to the exposure of sensitive files.
Vulnerability Detail
The vulnerability in mcp-server-git arises from the git_add tool, which failed to validate file paths provided in the files argument. This oversight allowed relative paths containing '..' sequences to be accepted, enabling files outside the repository to be staged into the Git index. This could lead to sensitive files being inadvertently committed and pushed to remote repositories, posing a significant security risk. The issue was traced back to the use of GitPython's repo.index.add(), which did not enforce necessary boundary checks for working-tree 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 should avoid using relative paths that include '..' when staging files. Instead, ensure that all file paths provided to the git_add tool are strictly within the repository boundaries.
Conclusion
The mcp-server-git package had a significant vulnerability that allowed for path traversal, potentially exposing sensitive files. Users are strongly advised to upgrade to version 2026.1.14 or newer to mitigate this risk. Additionally, employing Vulert can help in monitoring and managing vulnerabilities in your software dependencies effectively.
See every vulnerability recorded for mcp-server-git →
FAQ
The CVSS score of this vulnerability is 6.4, indicating a medium severity level.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If exploited, this vulnerability could allow unauthorized access to sensitive files outside the repository, leading to data leaks and security breaches.
Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just the Pipfile.lock.
If an immediate upgrade is not possible, ensure that you do not use relative paths that could lead outside the repository when staging files.
References
Related vulnerabilities
Recent vulnerabilities recorded for mcp-server-git.