CVE-2026-27735: mcp-server-git Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-vjqx-cfc4-9h6v
CWE-22
Published
Advisory Summary

CVE-2026-27735 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting mcp-server-git libraries in the PyPI ecosystem. The issue involves path traversal in git_add allows staging files outside repository boundaries. Remediation is available by upgrading affected packages to version 2026.1.14.

CVE-2026-27735 at a Glance

CVE Identifier CVE-2026-27735
GHSA Identifier GHSA-vjqx-cfc4-9h6v
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product mcp-server-git
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-27735

To remediate this vulnerability, upgrade all affected mcp-server-git dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mcp-server-git fixed: 2026.1.14
pip install mcp-server-git>=2026.1.14
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show mcp-server-git

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-27735, inspect your installed packages using pip:

pip show mcp-server-git

Analyze the terminal output to locate any version of mcp-server-git in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.1.14), your application is affected.

Note: The pip show mcp-server-git command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In mcp-server-git, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2026-27735 Affected mcp-server-git Versions

1 component(s)
Fixed Versions:
2026.1.14
Product / Package Ecosystem Affected Versions Fixed Version
mcp-server-git
PyPI
< 2026.1.14
2026.1.14

References

Frequently Asked Questions

What is CVE-2026-27735?
CVE-2026-27735 is a security vulnerability in mcp-server-git involving Path traversal in git_add allows staging files outside repository boundaries under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which mcp-server-git versions are affected?
Affected versions include releases prior to 2026.1.14 across affected packages: mcp-server-git.
What version fixes CVE-2026-27735?
Upgrading to 2026.1.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mcp-server-git affected?
Yes, mcp-server-git is affected in releases prior to 2026.1.14. Upgrade your dependency to 2026.1.14 or later.
What CWE is associated with CVE-2026-27735?
CVE-2026-27735 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2026-27735?
Run the dependency tree command: 'pip show mcp-server-git'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vjqx-cfc4-9h6v",
  "modified" : "2026-02-26T15:16:57Z",
  "published" : "2026-02-26T15:16:57Z",
  "aliases" : [ "CVE-2026-27735" ],
  "summary" : "mcp-server-git : Path traversal in git_add allows staging files outside repository boundaries",
  "details" : "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.\n\nmcp-server-git thanks https://hackerone.com/0dd-g for reporting and contributing the fix.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mcp-server-git"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2026.1.14"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-vjqx-cfc4-9h6v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27735"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/servers/pull/3164"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/servers/commit/862e717ff714987bd5577318df09858e14883863"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/modelcontextprotocol/servers"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-26T15:16:57Z",
    "nvd_published_at" : "2026-02-26T00:16:25Z"
  }
}