<?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>Cve-2026-39394 - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/cve-2026-39394/</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>Tue, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/cve-2026-39394/feed.xml" rel="self" type="application/rss+xml"/><item><title>CI4MS .env File Injection Vulnerability (CVE-2026-39394)</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-ci4ms-env-injection/</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-02-ci4ms-env-injection/</guid><description>CI4MS versions prior to 0.31.4.0 are vulnerable to .env file injection via the Install::index() controller due to insufficient input validation and bypassed CSRF protection, allowing attackers to inject arbitrary configuration directives.</description><content:encoded><![CDATA[<p>CI4MS is a CodeIgniter 4-based CMS skeleton designed to provide a production-ready, modular architecture with features like RBAC authorization and theme support. Versions prior to 0.31.4.0 contain a critical vulnerability (CVE-2026-39394) within the Install::index() controller. This controller reads the 'host' POST parameter without proper validation and passes it directly to the <code>updateEnvSettings()</code> function. This function, in turn, uses <code>preg_replace()</code> to write the value into the .env file. The lack of newline character stripping in the input allows an attacker to inject arbitrary configuration directives. Furthermore, the installation routes have CSRF protection explicitly disabled, and the InstallFilter can be bypassed when the <code>cache('settings')</code> is empty, such as during initial deployment or after cache expiry. This vulnerability allows unauthenticated attackers to modify the application's configuration, leading to potentially complete system compromise. CI4MS deployments are vulnerable until upgraded to version 0.31.4.0 or later.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An unauthenticated attacker sends a POST request to the <code>/install</code> route with a malicious 'host' parameter.</li>
<li>The <code>Install::index()</code> controller receives the POST request.</li>
<li>The controller bypasses CSRF protection due to it being explicitly disabled.</li>
<li>The <code>InstallFilter</code> is bypassed because the <code>cache('settings')</code> is empty (e.g., on a fresh deployment).</li>
<li>The 'host' parameter, containing injected configuration directives with newline characters, is passed to the <code>updateEnvSettings()</code> function.</li>
<li>The <code>updateEnvSettings()</code> function uses <code>preg_replace()</code> to write the attacker-controlled 'host' parameter into the .env file without proper sanitization.</li>
<li>The injected configuration directives are written into the .env file, modifying the application's configuration.</li>
<li>The attacker can now leverage the modified configuration for further malicious activities, such as gaining unauthorized access, escalating privileges, or injecting malicious code.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to inject arbitrary configuration directives into the .env file. This can lead to a wide range of consequences, including but not limited to: database credential compromise, modification of application behavior, remote code execution, and complete system takeover. The number of potential victims is dependent on the number of CI4MS deployments running vulnerable versions (pre-0.31.4.0). Targeted sectors are likely to be diverse, reflecting the broad range of applications for which CI4MS is used.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade CI4MS to version 0.31.4.0 or later to patch CVE-2026-39394.</li>
<li>Monitor web server logs for POST requests to the <code>/install</code> route containing newline characters in the 'host' parameter to detect potential exploitation attempts. Implement the provided Sigma rules to detect this activity.</li>
<li>Implement strict input validation on all user-supplied data, especially for parameters that are used to modify configuration files.</li>
<li>Ensure that CSRF protection is enabled and functioning correctly for all sensitive routes, including installation routes.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>ci4ms</category><category>codeigniter</category><category>env-injection</category><category>cve-2026-39394</category></item></channel></rss>