CVE-2026-27735
JSON

6.4medium

mcp-server-git : Path traversal in git_add allows staging files outside repository boundaries

Severity
6.4medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.56% (higher than 40% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-vjqx-cfc4-9h6vPYSEC-2026-2630

Description

Model Context Protocol Servers is a collection of reference implementations for the model context protocol (MCP). In mcp-server-git versions prior to 2026.1.14, the git_add tool did not validate that file paths provided in the files argument were within the repository boundaries. Because the tool used GitPython's repo.index.add() rather than the Git CLI, relative paths containing `../` sequences that resolve outside the repository were accepted and staged into the Git index. Users are advised to upgrade to 2026.1.14 or newer to remediate this issue.

Affected

Product or packageVersionsReported by
modelcontextprotocol servers< 2026.1.14CVE List
mcp-server-git (PyPI)before 2026.1.14GitHub Advisory Database, PyPA Advisory Database
lfprojects model_context_protocol_serversbefore 2026.1.14NVD

All scores

GitHub_M6.4medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N

Classification

CWE-22

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Model Context Protocol Servers is a collection of reference implementations for the model context protocol (MCP). In mcp-server-git versions prior to 2026.1.14, the git_add tool did not validate that file paths provided in the files argument were within the repository boundaries. Because the tool used GitPython's repo.index.add() rather than the Git CLI, relative paths containing `../` sequences that resolve outside the repository were accepted and staged into the Git index. Users are advised to upgrade to 2026.1.14 or newer to remediate this issue.

GitHub Advisory Database

In mcp-server-git versions prior to 2026.1.14, the git_add tool did not validate that file paths provided in the files argument were within the repository boundaries. The tool used GitPython's repo.index.add(, which did not enforce working-tree boundary checks for relative paths. As a result, relative paths containing ../ sequences that resolved outside the repository were accepted and staged into the Git index, potentially allowing sensitive files to be exfiltrated via subsequent commit and push operations. The fix in PR #3164 switches to repo.git.add(), which delegates to the Git CLI and properly rejects out-of-tree paths. Users are advised to upgrade to 2026.1.14 or newer to remediate this issue.

mcp-server-git thanks https://hackerone.com/0dd-g for reporting and contributing the fix.

NVD (es)

Servidores de Protocolo de Contexto de Modelo es una colección de implementaciones de referencia para el protocolo de contexto de modelo (MCP). En versiones de mcp-server-git anteriores a 2026.1.14, la herramienta git_add no validaba que las rutas de archivo proporcionadas en el argumento files estuvieran dentro de los límites del repositorio. Debido a que la herramienta utilizaba repo.index.add() de GitPython en lugar de la CLI de Git, las rutas relativas que contenían secuencias '../' que se resolvían fuera del repositorio eran aceptadas y preparadas en el índice de Git. Se aconseja a los usuarios que actualicen a la versión 2026.1.14 o posterior para solucionar este problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-27735 changed 2026-02-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-vjqx-cfc4-9h6v changed 2026-07-13CC-BY-4.0
NVDCVE-2026-27735 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-2630 changed 2026-07-13CC-BY-4.0