The Git MCP tool invoked a merge in a repository that could carry an attacker-controlled recentObjectsHook configuration. Git could invoke that hook as part of its routine object-maintenance behavior, giving a repository a process-execution path through an apparently ordinary model-requested merge. This path depends on how the trusted host Git version and…
Inspect the ClaimsCase · DiggingBeagle record
Git MCP merge path could execute a repository configured garbage-collection hook
Repository-controlled Git configuration made a tool-mediated merge cause an unexpected process through recentObjectsHook.
Published by DiggingBeagle:
MCP Git server 2026.11.11; an attacker can influence the repository configuration examined by a model-connected Git tool; Git recentObjectsHook is supported on some newer Git versions.
Assessment profile
Assessment method- Setting
- research demonstration
- Exploitation
- demonstrated
- Evidence
- Grade B
- Remediation
- patch available
- AI role
- AGAINST AI
Basis and provenance
Vendor or researcher primary evidence establishes the stated mechanism and its bounds; the public record does not support a population-wide impact score, prevalence or generalization to installations without the prerequisites.
Assessed Nov 21, 2026 using diggingbeagle.assessment/1.
Evidence basis: CLM-2026-NOV21-GITMCP-GC-HOOK-1 · CLM-2026-NOV21-GITMCP-GC-HOOK-2 · CLM-ENR271-GITMCP-GC-HOOK · MCP Git server advisory GHSA-h2g3-rwxm-xfm3 on git mcp merge path could execute a repository configured garbage-collection hook
At a glance
A successful or fast-forward merge can trigger automatic Git maintenance. In the documented conditions, gc.recentObjectsHook was not among the server-pinned configuration keys, so an attacker-controlled repository could select the command run during that maintenance. The result depends on appropriate Git versions and auto-maintenance conditions; it is not…
Read the implicationsThe advisory documents a code path and reproduction, not confirmed compromise of arbitrary Git MCP deployments. It requires an attacker-influenced repository and the relevant Git configuration behavior.
Limits and uncertaintyFull account
The Git MCP tool invoked a merge in a repository that could carry an attacker-controlled recentObjectsHook configuration. Git could invoke that hook as part of its routine object-maintenance behavior, giving a repository a process-execution path through an apparently ordinary model-requested merge. This path depends on how the trusted host Git version and repository configuration are handled. The upstream server release 2026.11.18 disables this untrusted effect route.
The advisory documents a code path and reproduction, not confirmed compromise of arbitrary Git MCP deployments. It requires an attacker-influenced repository and the relevant Git configuration behavior.
Mechanism and trust boundary
- 01
Git maintenance configuration supplied by repository
The repository defines automatic garbage-collection controls including a command-bearing gc.recentObjectsHook option.
Boundary: untrusted repository config -> Git maintenance behavior
- 02
Merge invokes automatic maintenance
A merge causes Git to start maintenance with that unpinned hook, executing under the MCP server user if the environmental conditions hold.
Boundary: allowed Git merge -> host process execution
Claims & evidence
CLM-ENR271-GITMCP-GC-HOOKThe disclosure reports a command execution path through gc.recentObjectsHook during post-merge automatic maintenance, with git 2.42 or later as a prerequisite.supported
Basis: reported finding
- supportsMCP Git server advisory GHSA-h2g3-rwxm-xfm3 on git mcp merge path could execute a repository configured garbage-collection hookprimary disclosure
Summary: automatic post-merge maintenance and gc.recentObjectsHook
CLM-2026-NOV21-GITMCP-GC-HOOK-1Repository-controlled Git configuration made a tool-mediated merge cause an unexpected process through recentObjectsHook.supported
Basis: reported finding
- supportsMCP Git server advisory GHSA-h2g3-rwxm-xfm3 on git mcp merge path could execute a repository configured garbage-collection hookprimary disclosure
Security advisory: affected Git MCP 2026.11.11, merge and recentObjectsHook process path
CLM-2026-NOV21-GITMCP-GC-HOOK-2The maintainer identifies 2026.11.18 as the fixed Git MCP release for this mechanism.supported
Basis: reported finding
- supportsMCP Git server advisory GHSA-h2g3-rwxm-xfm3 on git mcp merge path could execute a repository configured garbage-collection hookprimary disclosure
Security advisory: patched version and affected range
Implications
A successful or fast-forward merge can trigger automatic Git maintenance. In the documented conditions, gc.recentObjectsHook was not among the server-pinned configuration keys, so an attacker-controlled repository could select the command run during that maintenance. The result depends on appropriate Git versions and auto-maintenance conditions; it is not the same as the abort-time config-include path.
Controls and mitigations
- Upgrade the MCP Git server to the fixed 2026.11.18 release and keep its operating-system privileges restricted.
- Test repository-originated Git configurations and nested state separately from the chat model, using a synthetic repository and non-sensitive host files.
Unknowns and contradictions
- The advisory documents a code path and reproduction, not confirmed compromise of arbitrary Git MCP deployments. It requires an attacker-influenced repository and the relevant Git configuration behavior.
Sources and citation
Material revision history
- Nov 21, 2026 · Published version · first publication · revision 272