On 27 November, the official MCP servers repository published five security advisories. The most serious one hits mcp-server-git, the server that gives Git commands to an AI agent. It promised never to run a program named by the repository's own configuration. With Git LFS installed, the promise did not hold. A git_status, a read-only tool, was enough to run code with your rights.

TL;DR: a .git directory supplied by someone else is code. Its config file can name a program, and Git runs it on the first git status. mcp-server-git emptied those keys, but not the ones Git LFS reads for itself. The fix is in version 2026.11.27, with no CVE number: your scanner will not warn you. Before you open a repository you did not clone yourself, list its filters, or run your agent without your tokens.

State of the sources and of my machine: checked on 1 December 2026. Check the version of your MCP servers before you act.

This article is for developers who give Git tools to an AI agent, and for teams that let it read repositories they did not write.

A normal clone does not carry the .git/config file. Your own Git creates it, on your machine. But a repository often arrives another way. A zip archive, a shared folder, a repository copied with its .git, a repository already on the machine. In those cases the .git comes along, and someone else wrote its content.

That file can name programs. A filter is the simplest example. The key filter.<name>.clean names a command, and a .gitattributes file says which files go through it. A hook does the same at other moments.

The detail that matters: after an archive unpacks, each file's timestamp no longer matches the index. Git then runs the clean filter again on every file it applies to, on the very first git status. No commit needed, no network needed. Reading the repository already runs it.

I wrote in July that an agent's rights in dev are not its rights in prod. And in October that every field an agent reads is a prompt. Here is the Git version of the same rule: every repository the agent opens is a program.

MCP is the protocol that connects an agent to tools. mcp-server-git is the reference server for Git, maintained in the official modelcontextprotocol/servers repository. It exposes tools such as git_status, git_diff, git_show, git_checkout and git_merge.

Its README has a section on this exact topic, "A repository's own programs". It is clear: "the server never runs a program they name, with or without --repository". To keep that promise, every Git command it runs overrides the repository's configuration. Hooks point at the null device. External diffs are off. Every filter and every merge driver the repository defines is emptied.

The same README adds one sentence: "Drivers from your global or system configuration, such as Git LFS's, keep working". That makes sense. The LFS filter comes from your own configuration, not from the repository. It is trusted. That is where the researcher looked.

Git LFS stores large files outside the repository. The command git lfs install writes four keys into your global config: filter.lfs.clean, filter.lfs.smudge, filter.lfs.process and filter.lfs.required. From then on, Git calls git-lfs for every LFS-tracked file.

The problem fits in one sentence. The git-lfs program, started by your trusted filter, then reads its own settings from the repository's .git/config. And several of those settings name a program. Advisory GHSA-6663-fm5v-gqm5 lists them, each confirmed by a test:

lfs.extension.<name>.clean: run by git_status, git_diff_unstaged, git_diff and git_add lfs.extension.<name>.smudge: run by git_checkout and git_merge lfs.standalonetransferagent with lfs.customtransfer.<name>.path: run by core.sshCommand, credential.helper and core.askpass: run by lfs.url points at a server the repository chooses The git_status case is the worst. It needs no network and no LFS object. The result sent back to the agent says "nothing to commit, working tree clean". Nothing shows that a program just ran with your rights.

A read-only git_status ran the program the repository named. The server empties the repository's filters, but your LFS filter stays active, and git-lfs reads its config from the repository. The reply to the agent shows nothing.

The researcher tested version 2026.11.18, with git 2.54.0 and git-lfs 3.7.1, on macOS. The official Docker image is affected in every case: its Dockerfile runs git lfs install --system. And the documented Docker setup mounts your home directory read-write into the container.

The fix shipped on 27 November, version 2026.11.27 on PyPI. The README now says the repository's LFS keys are emptied too: lfs.extension.*, lfs.customtransfer.*, lfs.standalonetransferagent. And the server never downloads an LFS object any more: GIT_LFS_SKIP_SMUDGE=1. A git_checkout writes the pointer files, and you run git lfs pull yourself afterwards.

The four other advisories of 27 November are smaller, but they tell the same story. The server promises a boundary, and a detail of Git slips through.

.git file that contains gitdir: /other/repo/.git retargets the configured root. git_show then reads the commits of another repository on the machine, despite --repository. Medium severity..git/objects/info/alternates during a .env, despite the --no-overwrite-ignore option. Low severity, since 2026.11.4. On 1 December, none of the five has a CVE number. None is in GitHub's global advisory database: the API answers 404. The OSV database knows no vulnerability for mcp-server-git 2026.11.18. So Dependabot will not open a PR, and pip-audit will say everything is fine. The only source is the repository's Security tab.

I already wrote that your vulnerability scanner is itself a dependency. Here it is simpler still: the scanner has nothing to scan. The information never entered its databases.

Five advisories, zero CVEs, one version that fixes them. As long as the advisories have no number, Dependabot and pip-audit stay silent. The update is a manual decision.

I checked my machine on 1 December. My Claude Code configuration declares MCP servers in 6 projects out of 94. The servers are context7, playwright, a Dokploy server, a Pixellab server and a Blender server. My Codex declares a node_repl and the same Blender server. No mcp-server-git, and the package is not installed.

I could stop there. That would be a mistake. Git 2.53.0 and git-lfs 3.7.1 are installed, and I ran git lfs install one day: my global config holds the four filter.lfs.* keys. The advisory's condition is met on my machine. And my agents do not need mcp-server-git to run Git. Claude Code runs git status itself in every repository I open.

That is the real point. mcp-server-git at least tried to empty the repository's config. A git status an agent runs in a shell tries nothing at all. A repository delivered with its .git, a filter declared inside, a .gitattributes that applies it. The program runs with my rights, my SSH keys and my tokens. I replayed the advisory's proof-of-concept script on my machine on 1 December, in a temporary directory, with no network. With mcp-server-git 2026.11.18, git_status answered "working tree clean" and the program named by .git/config ran as my user. With 2026.11.27, the tool returns an error and nothing runs.

At home today, two hooks filter my agent's commands before they run, not a separate user. They would have blocked nothing here: git status is an allowed command. The problem is the program behind it, and a command filter cannot see it.

In November, a security tool added itself to my agent's config. The lesson was the same: what enters the agent's configuration decides what it runs. The .git/config of an unknown repository is one more configuration.

First check: list the programs the repository's config names. One command, to run before any git status, before you open the agent in the folder:

git -C /path/to/repo config --local --get-regexp \
  '^(filter|merge|diff|lfs\.extension|lfs\.customtransfer|lfs\.standalonetransferagent|core\.(hooksPath|fsmonitor|sshCommand|askpass)|credential\.helper)'
ls -l /path/to/repo/.git/hooks | grep -v '\.sample$'
cat /path/to/repo/.git 2>/dev/null   # a file, not a directory: read where gitdir points

On a repository you cloned yourself, the first command returns nothing, or only your own settings. On a repository received with its .git, every line is a program you did not choose. The second command shows the real hooks: .sample files are inert, the others run. The third one catches the gitdir: pointer of the second advisory.

Second check: pin the server version, and watch the repository's Security tab rather than Dependabot. uvx mcp-server-git@2026.11.27 or pip install mcp-server-git==2026.11.27. For the Memory server, @modelcontextprotocol/server-memory@2.2.2. Write down the date of your last visit to the advisories page, because nothing will come and find you.

Third check, the only one that holds when the first two fail: run the agent without your tokens. A separate Unix user, with no ~/.ssh, no cloud credentials file, no git lfs install. Or a container with only the repository mounted, and GIT_LFS_SKIP_SMUDGE=1 in its environment. If a program runs anyway, it runs with nothing. That is the rule of my article on agent rights, applied to Git.

As an aside, the everything server in the same repository listened on every network interface by default. PR 5452, merged on 5 November, brought it back to 127.0.0.1. Same family: a reference server is not a hardened server.

A repository received with its .git is a program. Read its config before you let the agent read its files.

git config --local --get-regexp on filter, merge, diff, lfs.*, core.hooksPath, .git/hooks without the .sample files, and read the gitdir: git lfs install wrote filter.lfs.* into your global config: git config --global --get-regexp '^filter\.lfs' mcp-server-git to 2026.11.27 and server-memory to 2.2.2, with the versions pinned in your MCP configmodelcontextprotocol/servers: these advisories have no CVE, Dependabot will not see them~/.ssh and no tokens, with GIT_LFS_SKIP_SMUDGE=1 mcp-server-git did better than most tools: it wrote down its promise, and someone could test it. The flaw is in the layer below, where a trusted program reads a configuration that is not. Git has always worked this way.

Your agent cannot tell a repository you cloned from an archive someone sent you. You can. One command before you open, one user without tokens to run. The rest is trust, and trust cannot be scanned.

Want to know what your agents can run with your rights today? Have a look at my DevSecOps audit offer, or let's talk.

原文来源:dev.to