highresolved

mcp-server-git command execution via automatic Git maintenance

A repository-controlled gc.recentObjectsHook could execute as the MCP server user when git_merge triggered automatic Git maintenance. mcp-server-git 2026.11.18 disables automatic maintenance and garbage collection for server Git commands.

Git merges in mcp-server-git 2026.11.11 could invoke Git automatic maintenance. An attacker-controlled repository configuration could set gc.recentObjectsHook so that garbage collection ran a command as the server user after git_merge.

The Model Context Protocol servers project released mcp-server-git 2026.11.18 in v2.5.0. The fix sets maintenance.auto to false and gc.auto to 0 for Git commands run by the server.

Takeaway

Upgrade mcp-server-git to 2026.11.18. Do not treat repository configuration as harmless when an agent can invoke Git tools against untrusted repositories.

Sources

mcpmcp-server-gitghsa-h2g3-rwxm-xfm3