Update mcp-server-git to 2026.11.11 or later, and only point it at repositories whose .git folder you trust

Reference Git MCP server ran attacker commands from a repo's own .git/config during read-only tools · Security incident · GitHub · modelcontextprotocol · Nov 11, 2026

What happened

Advisory GHSA-6hqx-gqrx-c5r2 (published 11 Nov 2026, rated High) covers mcp-server-git, the reference Git MCP server in modelcontextprotocol/servers. It ran Git without overriding the repository's own config, so a .git/config with a core.fsmonitor or diff.external command made the read-only git_status or git_diff tools run that command with the MCP server's privileges, including any credentials in its environment, with no approval prompt. The payload rides along when a folder is copied with its .git directory intact (an archive, backup, shared folder or CI artifact), not a plain git clone. Fixed in 2026.11.11.

How to prevent it

Upgrade mcp-server-git to 2026.11.11 or later. Don't let an agent run Git tools inside folders you unpacked from archives or shared drives, and keep secrets out of the MCP server's env block where you can.

Fix prompt for your own AI tool

Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.

I use MCP, which can read web pages, files, emails or tool output. Help me reduce the risk of prompt injection (hidden instructions in content the AI reads). 1) List what my setup can access (files, terminal, browser, MCP servers, email, databases) and what it can do without asking me. 2) Point out the riskiest combinations, e.g. reading untrusted content while also having access to secrets or the ability to send data out. 3) Suggest concrete settings: require approval for commands and network calls, remove MCP servers I don't need, use read-only tokens, and keep the tool updated. 4) Give me a short checklist to follow before opening untrusted repos or documents. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.

Why this keeps happening: trusting agents & ai input

An AI agent treats everything it reads as possible instructions: a web page, a README, an email, a code comment or the output of another tool. If that content was written by an attacker, the agent can be steered into running commands, reading files or sending data somewhere it should not.

A quick checklist before you ship

More on this: every trusting agents & ai input story and our related guide.

Tools involved

MCP stories, mcp-server-git stories, Claude stories, Cursor stories

Related stories

Source: original post on GitHub ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.

The Honest Build. Real stories, not hype.

Every week: real stories of what building with AI actually took, the one lesson worth keeping, and the security slip-ups to avoid. Free, unsubscribe anytime. Weekly, every Friday.