<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>GitPython (&gt;= 3.1.30, &lt; 3.2.0) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/gitpython--3.1.30--3.2.0/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 29 Oct 2026 23:25:26 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/gitpython--3.1.30--3.2.0/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>GitPython: Remote.pull() arbitrary command execution via refspec injection</title><link>https://feed.craftedsignal.io/briefs/2026-10-gitpython-rce-8a12154e/</link><pubDate>Thu, 29 Oct 2026 23:25:26 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-10-gitpython-rce-8a12154e/</guid><description>The GitPython library fails to validate the refspec positional argument in Remote.pull(), allowing attackers to inject shell commands via --upload-pack options when using SSH or local transports.</description><content:encoded><![CDATA[<p>GitPython's <code>Remote.pull()</code> method contains a vulnerability in its security guard intended to prevent command injection. While the library attempts to block dangerous options like <code>--upload-pack</code>, the guard only inspects keyword arguments and fails to validate the positional <code>refspec</code> argument. An attacker can supply a refspec starting with <code>--upload-pack=</code>, which is forwarded to the underlying <code>git pull</code> process. Because <code>git pull</code> does not properly terminate positional arguments before passing them to internal <code>git fetch</code> operations, the injected command is executed as the <code>upload-pack</code> program. Exploitation is possible when using local filesystem or SSH transports. No fix is currently available.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Exposure: An application calls <code>Remote.pull(refspec=&lt;value&gt;)</code> where <code>&lt;value&gt;</code> is derived from attacker-influenced input.</li>
<li>Control: The attacker provides a string such as <code>--upload-pack=&lt;command&gt;; git-upload-pack</code>.</li>
<li>Path: The input passes through <code>Git._unpack_args</code> and <code>Git.check_unsafe_protocols</code> without being flagged as malicious.</li>
<li>Guard: The unsafe-option guard incorrectly assumes positionals are safe, failing to check the <code>refspec</code> against <code>unsafe_git_pull_options</code>.</li>
<li>Primitive: The <code>refspec</code> is passed to <code>git pull -v -- &lt;remote&gt; &lt;refspec&gt;</code>.</li>
<li>Execution: The <code>git pull</code> command forwards the positional to an internal <code>git fetch</code> without a <code>--</code> separator, causing the system to execute the injected command as the <code>upload-pack</code> program.</li>
<li>Result: Arbitrary command execution occurs on the system with the privileges of the calling process.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows arbitrary command execution as the user running the GitPython process. This requires the use of SSH or local filesystem transports; HTTPS transports are not affected as the server ignores the client-supplied upload-pack program.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Validate that all <code>refspec</code> strings passed to <code>Remote.pull()</code> do not start with a hyphen (<code>-</code>).</li>
<li>Prefer HTTPS remotes over local-path or SSH transports where possible.</li>
<li>Avoid passing untrusted user input directly into GitPython method arguments.</li>
<li>Monitor for GitPython processes spawning child processes that are not standard git utilities or that originate from unexpected command-line arguments.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>remote-code-execution</category><category>gitpython</category><category>library-vulnerability</category></item></channel></rss>