You gave your agent the Git MCP server so it could look at git status and git diff without a shell. Both are marked read-only. Until yesterday, if Git LFS was installed and the agent called git_status on a repository someone else prepared, that repository could make the server run a program of its choosing, as you.
On November 27 the Model Context Protocol project published v2.6.0 of its reference servers. The release notes say it "fixes eight vulnerabilities in three servers", and six of them are in mcp-server-git. The fixed version is mcp-server-git 2026.11.27 on PyPI. This post explains each Git fix in plain words, then what to change in your config. We build Sessionboxer, which runs MCP servers inside each session's container; that part is near the end and is short.
The one to read first: Git LFS and git_status
The server's README has a section called "A repository's own programs". It says a repository's configuration and hooks travel with it, "so the server never runs a program they name". The server enforces that by overriding the Git settings that would start a program, such as filter drivers and merge drivers.
The advisory GHSA-6663-fm5v-gqm5, rated High, shows a gap. The server kept the Git LFS filter from your own global or system configuration, on purpose, so LFS repositories keep working. But once git-lfs runs, it reads its own keys from the repository's .git/config, and several of those keys name programs. The advisory lists them, among them lfs.extension.<name>.clean, lfs.extension.<name>.smudge and lfs.customtransfer.<name>.path. The server did not override any of them.
The git_status case needs no network and no LFS download. After an archive is unpacked, Git sees that each file's stat data differs from the index and runs the clean filter again. git-lfs then runs the extension program from .git/config. The tool result shows a clean working tree. Nothing in it tells you a program ran.
The advisory is precise about who is exposed:
- The attacker controls the repository's
.gitdirectory. A plaingit cloneof a hostile repository is not enough, because git-lfs ignores these keys in a tracked.lfsconfigfile. The risk is an unpacked archive, a shared folder or a vendored tree. - Git LFS is installed in your global or system config.
git lfs installdoes that. The server's official Docker image always has it, because its Dockerfile runsgit lfs install --system. --repositorydoes not help, since the hostile repository is the allowed one.
The author tested on macOS only and says so. The fix empties those keys at repository scope and sets GIT_LFS_SKIP_SMUDGE=1, so LFS downloads are off too.
The other five Git fixes
The rest are rated lower, but two of them leak secrets to the model, and that is what an injected prompt usually wants.
| Advisory | What went wrong | What 2026.11.27 does |
|---|---|---|
| GHSA-wvv2-676g-r57j | A remote name with a tab in it shifted the URL column, so redaction was skipped. With a credential-bearing url.<base>.insteadOf in your own ~/.gitconfig, the read-only git_remote tool returned your token to the model. |
Matches remote names against Git's own list and withholds any value that holds a URL anywhere but at its start. |
| GHSA-f33v-89w7-f9vc | GitPython expanded $NAME in repo_path, and the "path does not exist" error printed the expanded path. A tool call could read any environment variable of the server process. |
Takes repo_path and --repository literally. |
| GHSA-3whj-m8jj-x97q | A --repository root whose .git file pointed at another repository was accepted, so git_show served that other repository's content. |
Records the root's Git directories at startup and refuses a root whose .git names any other Git directory. |
| GHSA-5pwg-5xfw-x322 | An objects/info/alternates file could be rewritten between the check and Git's lookup, so git_show returned an object from another repository. |
Runs each call on a private object directory that links only the repository's own objects. |
| GHSA-qf89-h82f-h5r5 | git_merge passed --no-overwrite-ignore, but Git honors it only on a fast-forward. A merge of diverged branches replaced an ignored .env and reported success. |
Checks the incoming paths first and refuses the merge. |
The release also finishes a fix from v2.5.0: after git_checkout or git_merge writes the working tree, the server checks --repository again, because a checkout can write config that moves the working tree outside it. The other two vulnerabilities in the release are in @modelcontextprotocol/server-memory (fixed in 2.2.2) and mcp-server-fetch (fixed in 2026.11.27). On Windows, @modelcontextprotocol/server-filesystem 2.4.1 narrows an older gap too.
What to do today
Find every place that starts the server. It is usually one of these, in Claude Desktop, Claude Code, Cursor, VS Code or Zed config files:
{ "command": "uvx", "args": ["mcp-server-git", "--repository", "path/to/git/repo"] }
or docker run ... mcp/git. Then:
Get 2026.11.27. A bare
uvx mcp-server-gitruns whatever uv resolves. The uv docs showuvx <tool>@latestto run the latest version, anduvx <tool>@<version>to pin one. Pinning means you choose when to update, and you can check what you run:{ "command": "uvx", "args": ["mcp-server-git@2026.11.27", "--repository", "path/to/git/repo"] }If you use the Docker image, pull it again and check that it was rebuilt after November 27. If you installed with pip,
pip install -U mcp-server-git.Set
--repository. The README is blunt about this: without it, "the server reads and writes any Git repository the server process can reach." The one-click VS Code install buttons in the README add the server without--repository, so check those entries in particular.Look at your own
~/.gitconfig. Thegit_remoteleak needed a credential in aurl.<base>.insteadOfrewrite. That pattern is common in CI and on build machines (url."https://x-access-token:TOKEN@github.com/".insteadOf). A credential helper keeps the token out of URLs entirely.Think about what is in the server's environment. The
repo_pathbug read the server process's environment variables. Whatever your MCP client passes to the server, and whatever the server inherits, is what a future bug of this kind would expose. Pass it only what it needs, such as the commit identity variables the README documents.Be careful with archives and shared folders. The LFS bug needs a
.gitdirectory someone else wrote. If you unpack a customer's tarball or a vendored tree and ask an agent to look at it, that is the case the advisory describes.
If you also run @modelcontextprotocol/server-memory or server-filesystem from npm, note the release's warning: those packages moved from date versions to semantic versions, so npm ranks 2.2.2 below every 2025.x and 2026.x version and will not offer it as an upgrade. Install the version explicitly, for example npm install @modelcontextprotocol/server-memory@2.2.2.
Where the server runs matters more than its version
Every one of these bugs ends the same way: the server does something as the user who started it. On a laptop that user has your SSH keys, your browser profile and the tokens in your shell.
In Sessionboxer, a command-based MCP server you register in MCP servers runs inside the session's box, not on your machine. Each session is its own Docker container with its own copy of the code. A program that a hostile .git/config starts would run in that container, with what the container holds. As we write this, the Sandbox image does not install Git LFS, so the LFS case needs the agent or a setup script to install it first.
That does not make a box empty. It has the code you cloned, the agent's login and, while a GitHub entry is on for the session, a GitHub login for git and gh, as the GitHub login chapter of the guide explains. The box answers GitHub credentials through a credential helper, so there is no token in an insteadOf URL for git_remote to leak, but code running in the box can still ask the helper. For a session where the agent looks at an archive someone sent you, leave the GitHub entry off.
What Sessionboxer does not do: it does not update your MCP servers, it does not check their versions, and it does not filter what a server sends to the model. A server you registered as uvx mcp-server-git runs whatever version uv gives it. Edit the entry in Global settings to pin mcp-server-git@2026.11.27, and add --repository with the repository's path under /workspace while you are there. The MCP servers chapter shows where that entry lives.
If you added MCP servers by hand over the last year, read the list once. Our post on deprecated MCP servers your agent added shows how to find them, and several of the servers in it are archived, which means nobody will publish a release like this one for them.