Case · 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:

Scope

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.

At a glance

Mechanism and trust boundary

  1. 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

  2. 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

Link to claim
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

Link to claim
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

Link to claim

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

  1. Nov 21, 2026 · Published version · first publication · revision 272