Last week I reported a security bug in mcp-server-git, the official git server from the Model Context Protocol project (about 400K downloads a month on PyPI). It's patched in mcp-server-git 2026.11.18 and the maintainers rated it High (CVSS 7.8). Advisory: GHSA-8wv7-r664-7594.
What the server does
It gives an AI agent git tools like git_status, git_diff, git_checkout and git_add on a repository you point it at. So the agent can read and change code without you typing git commands yourself.
The bug, in plain terms
Git lets a repository's own config name programs to run, for example an external diff tool or a clean/smudge filter. A server that opens repositories it didn't create has to switch those off, and this one does: its README promises it never runs a program that a repository's configuration names, and it hardens the top-level repo's config.
The gap was submodules. A submodule is a repository inside the repository, and it has its own .git/config. Two code paths still ran git inside a submodule under that submodule's config, which the hardening never read:
- the diff tools (
git_diff,git_diff_staged,git_diff_unstaged), which are supposed to be read-only -
git_checkoutandgit_add
So if an agent worked in a repository folder someone else prepared, a normal diff, checkout or add could run that person's command on your machine. My test harness reproduced it 3 out of 3 times, and 0 out of 3 in the controls.
How worried should you be
Less than the score sounds, but still update. A normal git clone does not copy .git/config or a submodule's config, so cloning a repo off GitHub doesn't trigger this by itself. The repository has to reach you whole: a zip or tarball with the .git folder in it, a shared or mounted folder, a CI artifact, or a config something else already wrote.
The bigger lesson is about agents in general. An agent asked to "just look at this repo" can be handed a hostile one, and the user never typed a command. Treat any repository your agent opens as untrusted input, even when the agent is only reading.
The fix
Update to mcp-server-git 2026.11.18 or later. The fix I suggested was to force diff.submodule=short so the nested diff never starts, and to extend the list of emptied drivers to the filter names configured in submodules. The maintainers reworked the final fix through their own process.
Timeline
- Nov 13, 2026: reported privately through GitHub
- Nov 18, 2026: patched release and public advisory
Thanks to the MCP maintainers for a fast turnaround.
Top comments (0)