<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yusef Syed</title>
    <description>The latest articles on DEV Community by Yusef Syed (@yusef_syed_e5513cf2360a92).</description>
    <link>https://dev.to/yusef_syed_e5513cf2360a92</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4211817%2Fb86d4e69-673d-4c73-9cce-bcf0987f18e4.jpg</url>
      <title>DEV Community: Yusef Syed</title>
      <link>https://dev.to/yusef_syed_e5513cf2360a92</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yusef_syed_e5513cf2360a92"/>
    <language>en</language>
    <item>
      <title>A submodule's git config could make the official MCP git server run commands</title>
      <dc:creator>Yusef Syed</dc:creator>
      <pubDate>Thu, 19 Nov 2026 03:13:43 +0000</pubDate>
      <link>https://dev.to/yusef_syed_e5513cf2360a92/a-submodules-git-config-could-make-the-official-mcp-git-server-run-commands-5haf</link>
      <guid>https://dev.to/yusef_syed_e5513cf2360a92/a-submodules-git-config-could-make-the-official-mcp-git-server-run-commands-5haf</guid>
      <description>&lt;p&gt;Last week I reported a security bug in &lt;code&gt;mcp-server-git&lt;/code&gt;, the official git server from the Model Context Protocol project (about 400K downloads a month on PyPI). It's patched in &lt;strong&gt;mcp-server-git 2026.11.18&lt;/strong&gt; and the maintainers rated it &lt;strong&gt;High (CVSS 7.8)&lt;/strong&gt;. Advisory: &lt;a href="https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-8wv7-r664-7594" rel="noopener noreferrer"&gt;GHSA-8wv7-r664-7594&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the server does
&lt;/h2&gt;

&lt;p&gt;It gives an AI agent git tools like &lt;code&gt;git_status&lt;/code&gt;, &lt;code&gt;git_diff&lt;/code&gt;, &lt;code&gt;git_checkout&lt;/code&gt; and &lt;code&gt;git_add&lt;/code&gt; on a repository you point it at. So the agent can read and change code without you typing git commands yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug, in plain terms
&lt;/h2&gt;

&lt;p&gt;Git lets a repository's own config name programs to run, for example an external diff tool or a clean/smudge filter. A server that opens repositories it didn't create has to switch those off, and this one does: its README promises it never runs a program that a repository's configuration names, and it hardens the top-level repo's config.&lt;/p&gt;

&lt;p&gt;The gap was submodules. A submodule is a repository inside the repository, and it has its own &lt;code&gt;.git/config&lt;/code&gt;. Two code paths still ran git inside a submodule under that submodule's config, which the hardening never read:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the diff tools (&lt;code&gt;git_diff&lt;/code&gt;, &lt;code&gt;git_diff_staged&lt;/code&gt;, &lt;code&gt;git_diff_unstaged&lt;/code&gt;), which are supposed to be read-only&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git_checkout&lt;/code&gt; and &lt;code&gt;git_add&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So if an agent worked in a repository folder someone else prepared, a normal diff, checkout or add could run that person's command on your machine. My test harness reproduced it 3 out of 3 times, and 0 out of 3 in the controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  How worried should you be
&lt;/h2&gt;

&lt;p&gt;Less than the score sounds, but still update. A normal &lt;code&gt;git clone&lt;/code&gt; does not copy &lt;code&gt;.git/config&lt;/code&gt; or a submodule's config, so cloning a repo off GitHub doesn't trigger this by itself. The repository has to reach you whole: a zip or tarball with the &lt;code&gt;.git&lt;/code&gt; folder in it, a shared or mounted folder, a CI artifact, or a config something else already wrote.&lt;/p&gt;

&lt;p&gt;The bigger lesson is about agents in general. An agent asked to "just look at this repo" can be handed a hostile one, and the user never typed a command. Treat any repository your agent opens as untrusted input, even when the agent is only reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;Update to &lt;code&gt;mcp-server-git&lt;/code&gt; 2026.11.18 or later. The fix I suggested was to force &lt;code&gt;diff.submodule=short&lt;/code&gt; so the nested diff never starts, and to extend the list of emptied drivers to the filter names configured in submodules. The maintainers reworked the final fix through their own process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timeline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Nov 13, 2026: reported privately through GitHub&lt;/li&gt;
&lt;li&gt;Nov 18, 2026: patched release and public advisory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks to the MCP maintainers for a fast turnaround.&lt;/p&gt;

</description>
      <category>security</category>
      <category>mcp</category>
      <category>ai</category>
      <category>git</category>
    </item>
  </channel>
</rss>
