Rightshold™ Sign up

Answers · MCP security

Our coding agent uses the official MCP git server (mcp-server-git from the modelcontextprotocol/servers repo). If the agent runs git_status or a diff on a repository we downloaded, unpacked or were sent, can that repository run a program on our machine, and does the November 11, 2026 release fix it?

Last updated

TL;DR: Yes, before mcp-server-git 2026.11.11. Advisory GHSA-6hqx-gqrx-c5r2 (high, CVSS 3.1 7.8, published November 11, 2026) shows that the server ran Git inside whatever repository the client named without overriding that repository's own .git/config. Git runs the program named in core.fsmonitor whenever it refreshes the index, so a call to the read-only git_status tool (and git_diff_unstaged, git_add and git_merge) ran an attacker-chosen command with the MCP server's user, files and environment, including any credentials passed in the client's env block, with no approval prompt and with or without --repository. The report also lists diff.external, hooks, filter drivers and commit signing as routes through other tools, and demonstrated diff.external the same way. The payload has to arrive with its .git folder intact (an archive, a backup, a CI artifact, a shared folder, a vendored or copied tree); a plain git clone and GitHub's source ZIP don't carry a repository's .git/config. Upgrade to 2026.11.11, which forces those settings off for every Git command it runs and refuses Git older than 2.31. The advisory lists no workaround other than upgrading; until then, only point the server at repositories whose .git folder you trust.

What should I check, step by step?

1. Find every MCP client config that starts mcp-server-git (uvx, pip, Docker or a pinned path) and check the version it resolves to. Anything before 2026.11.11 is affected; the report confirmed 2026.10.28 and 2026.11.4 and presumes earlier versions are too.

  1. Upgrade to mcp-server-git 2026.11.11 or later (published on PyPI at 2:09 AM ET on November 11, 2026) and pin the version you reviewed instead of letting uvx pick latest.
  2. Check the Git on that machine: the fixed server refuses Git older than 2.31, because older Git ignores the GIT_CONFIG_COUNT variables the fix relies on.
  3. Until you've upgraded, don't let the agent run any git tool on a folder that arrived with its .git directory from somewhere else: an unpacked archive or CI artifact, a restored backup, a shared drive, a vendored dependency tree or a workspace copied from another agent.
  4. Before trusting such a folder, read its .git/config yourself (or run git config --local --list) and look for core.fsmonitor, core.hooksPath, diff.external, any diff.<name>.command or textconv, filter.<name>.clean/smudge/process and gpg.program.
  5. Don't count on Git's safe.directory check: it only refuses repositories owned by another user, and a folder you unpacked yourself is owned by you.
  6. Keep secrets out of the git server's env block. Whatever that process can read, a repository-supplied command could read before the fix.
  7. If the server runs with --repository on Windows, read the companion advisory GHSA-q74p-4wrc-q7w6: the confinement fix doesn't yet recognise directory junctions inside a Git directory.
  8. Run the git server in a sandbox or container with only the repository it needs and no network, so the next bug in this class runs with as little as possible.

How can a repository's .git/config run a program through mcp-server-git's git_status tool?

Git reads configuration from the repository's own .git/config as well as your global settings, and some keys name a program for Git to run. core.fsmonitor names a hook command Git calls to learn which files changed, so it fires on any index refresh, including a plain git status. The advisory's table maps each key to the server tools that triggered it: core.fsmonitor through git_status, git_diff_unstaged, git_add and git_merge; diff.external and diff.<driver>.command through the diff tools; core.hooksPath with hooks, and commit.gpgSign with gpg.program, through git_merge; filter.<driver>.clean through git_add.

What does the mcp-server-git 2026.11.11 fix for GHSA-6hqx-gqrx-c5r2 change?

The fix (pull request 5514) sets overrides through GIT_CONFIG_COUNT, which Git's documentation says outranks values in configuration files and which Git passes to the Git processes it starts itself: core.fsmonitor false, core.hooksPath pointed at the null device so no hook runs, commit.gpgSign and merge.verifySignatures false, submodule.recurse, status.submoduleSummary and merge.autoStash false, and core.pager set to cat.

What else did the November 11, 2026 MCP reference server advisories fix in the git, filesystem and fetch servers?

The same release fixed GHSA-q74p-4wrc-q7w6 (medium): with --repository, a caller who could write plain files inside the allowed repository could read objects from another repository through objects/info/alternates, or reach a main repository's index and HEAD through a nested .git file inside a linked worktree. It affects 2026.10.28 up to 2026.11.11 (earlier versions are covered by the October 28 advisory). The fix refuses alternate object stores under --repository and symbolic links in a Git directory that lead outside it; Windows directory junctions aren't recognised yet.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “My agent wants to run git_status on a repository it unpacked from a vendor's archive into vendor/acme-sdk. Ask me to approve that exact call first, with a record I can check, because the repository arrived with its .git folder.”

One-click setup

{
  "tool": "request_human_approval",
  "arguments": {
    "action": {
      "tool": "git_status",
      "server": "mcp-server-git",
      "repo_path": "vendor/acme-sdk",
      "source": "unpacked vendor archive with .git",
      "server_version": "2026.11.11"
    },
    "summary": "Run git_status on vendor/acme-sdk (unpacked archive, .git included)",
    "expires_in_minutes": 30
  }
}

Rightshold isn't affiliated with the Model Context Protocol project. It doesn't scan repositories, MCP server code or local configuration, and an approval record isn't a finding that a repository is safe. Advisory details are as published in the modelcontextprotocol/servers repository on GitHub on November 11, 2026, Git behavior as described in Git's documentation, and release dates as listed on PyPI and npm, all read November 11, 2026; advisories get updated, so confirm fixed versions on the linked pages.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'