<?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/"><channel><title>Newline Injection — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/newline-injection/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/newline-injection/feed.xml" rel="self" type="application/rss+xml"/><item><title>GitPython config_writer().set_value() Newline Injection RCE</title><link>https://feed.craftedsignal.io/briefs/2024-01-gitpython-rce/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-gitpython-rce/</guid><description>A newline injection vulnerability in GitPython's `config_writer().set_value()` function enables remote code execution by manipulating the `core.hooksPath` Git configuration.</description><content:encoded><![CDATA[<p>A newline injection vulnerability exists in GitPython&rsquo;s <code>config_writer().set_value()</code> function, allowing attackers to achieve remote code execution. The vulnerability occurs because <code>set_value()</code> does not validate for newlines before passing values to Python&rsquo;s <code>configparser</code>. GitPython&rsquo;s writer converts embedded newlines into continuation lines, which Git still interprets as valid configuration. An attacker can inject a <code>core.hooksPath</code> configuration, causing Git to execute scripts from an attacker-controlled path whenever hooks are invoked. Discovered during an audit of MLRun&rsquo;s <code>project.push()</code> method, the vulnerability is triggered when <code>author_name</code> or <code>author_email</code> are passed to <code>config_writer().set_value()</code> without sanitization. This affects GitPython versions up to 3.1.48, git 2.39+.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious input string containing a newline character followed by a <code>[core]</code> section and <code>hooksPath</code> setting.</li>
<li>The malicious string is passed as either the <code>author_name</code> or <code>author_email</code> parameter to an application using GitPython.</li>
<li>The application calls <code>config_writer().set_value()</code> with the attacker-controlled input, writing the malicious configuration to the <code>.git/config</code> file.</li>
<li>GitPython converts the embedded newline into an indented continuation line but still writes it to the config.</li>
<li>Git interprets the injected <code>[core]</code> stanza as a valid section header, thus setting the <code>core.hooksPath</code> to the attacker-specified path.</li>
<li>A Git operation that invokes hooks (e.g., commit, merge, checkout) is triggered.</li>
<li>Git executes the scripts located in the attacker-controlled <code>hooksPath</code>.</li>
<li>The attacker gains arbitrary code execution on the system.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation leads to persistent repository configuration poisoning. In multi-user environments, one user can poison a shared repository&rsquo;s <code>.git/config</code>, causing the attacker&rsquo;s hooks to run during subsequent Git operations by other users. The impact on single-user deployments depends on whether the application automatically invokes Git hooks. This vulnerability, now identified as CVE-2026-44244, can lead to privilege escalation and arbitrary code execution.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Detect Git config hooksPath modification</code> to identify attempts to modify the <code>core.hooksPath</code> setting in the <code>.git/config</code> file.</li>
<li>Audit all calls to <code>config_writer().set_value()</code> in your codebase, especially where user-supplied input is used, as suggested in the overview.</li>
<li>Upgrade to a patched version of GitPython that raises an error on CR, LF, or NUL in config values, as described in the remediation section.</li>
<li>Monitor process creation events for the execution of scripts from unusual or unexpected paths specified in the <code>core.hooksPath</code> using the rule <code>Suspicious Git Hook Execution</code>.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>newline injection</category><category>remote code execution</category><category>gitpython</category><category>config poisoning</category></item></channel></rss>