Skip to content
Driver fix

Driver fix

github.com • November 21, 2026

harden_repo reads the filter and merge drivers a repository defines, blanks them, and fixes that list in the environment of the git commands that follow. It does this once per tool call, before any git command runs.

A repository can [include] a file that does not exist yet. Git silently ignores an include whose path is missing, so the read finds nothing to blank.

git_merge then merges a branch that adds that file. The merge conflicts, and the server runs git merge --abort to restore the repository. That is a new git process. It reads the configuration again, the include now resolves, the filter it defines was never blanked, and restoring the file runs it.

The tool still reports that the merge was aborted and the repository is unchanged.

open_repo ( server.py L1207-L1220) calls harden_repo (L188-L226) once. That runs git config --get-regexp , which does follow includes, collects the repository-scope filter and merge drivers, and pins empty overrides for every later git command in the call.

With [include] path = ../evil.cfg in .git/config and no evil.cfg on the current branch, nothing is listed and nothing is blanked.

git_merge runs git merge (L622-L637). The source branch adds evil.cfg , which defines filter.x.smudge and filter.x.clean , and the current branch's .gitattributes already says * filter=x . That is harmless while x is undefined. The merge process read its configuration at startup, so it does not run the filter either. It writes evil.cfg into the working tree and stops on a conflict in another file.

_merge_failure (L530-L554) then starts new git processes: git diff --name-only --diff-filter=U and git merge --abort (L548). Each reads the configuration fresh, so the include resolves. filter.x is defined now and was never overridden, and restoring the conflicted file runs it.

In our runs, the payload's parent process was git merge --abort for both the clean and the smudge command.

Tested in a container with git 2.47.3 and mcp-server-git 2026.11.11:

The script builds the repository, then drives the real server over MCP stdio: git_status , then git_merge with fast_forward_only=false . The payload writes id output and the parent's command line to a file named with a random marker. There are two legs and two modes.

The control leg is identical except that .git/config has no [include] line, which is what isolates the include as the cause.

Arbitrary command execution as the user running the MCP server.

The preconditions are narrower than GHSA-6hqx-gqrx-c5r2 , so they are worth stating exactly:

The attacker supplies a repository with an attacker-written .git/config : an archive, a shared folder, a copied workspace. A plain clone does not carry it.

That repository has a branch which adds the included file and conflicts with the current branch.

Someone calls git_merge on that branch with fast_forward_only=false . That is not the default, but it is the documented way to merge diverged branches.

--repository confinement does not help. The tool's response looks like an ordinary merge conflict.

Read the drivers again before _merge_failure runs more git commands, since the merge may have created a file that the configuration includes:

With this change the exploit legs stop running the payload, whether or not the separate empty-driver-name issue is also fixed, and git_merge still reports the conflict and leaves the repository clean.

A broader option is to refuse repository-scope include.path and includeIf.*.path in harden_repo . That covers any future tool that changes the working tree and then runs git again. We did not test it.

Do not merge branches of repositories you received from someone else, or do it in a fresh clone where the .git/config is the one git wrote.

Run the server as a user without credentials that matter.

Require approval for git_merge specifically. The read-only tools are not affected here.

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

Extracted Entities

Attack Types (1)

Tools (1)