<?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>Bentoml — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/bentoml/</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>Fri, 03 Apr 2026 23:14:15 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/bentoml/feed.xml" rel="self" type="application/rss+xml"/><item><title>BentoML SSTI via Unsandboxed Jinja2 in Dockerfile Generation</title><link>https://feed.craftedsignal.io/briefs/2024-02-bentoml-ssti/</link><pubDate>Fri, 03 Apr 2026 23:14:15 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-02-bentoml-ssti/</guid><description>BentoML versions 1.4.37 and earlier are vulnerable to server-side template injection (SSTI), where the Dockerfile generation function uses an unsandboxed jinja2.Environment allowing arbitrary Python code execution on the host machine when a malicious bento archive is imported and containerized, bypassing container isolation and potentially granting full access to the host filesystem and environment variables.</description><content:encoded><![CDATA[<p>BentoML versions 1.4.37 and earlier contain a critical vulnerability related to server-side template injection (SSTI). The vulnerability stems from the use of an unsandboxed Jinja2 environment within the <code>generate_containerfile()</code> function, which is responsible for creating Dockerfiles. By crafting a malicious bento archive containing a specially crafted <code>dockerfile_template</code>, an attacker can inject arbitrary Python code that executes directly on the host machine when a victim imports and containerizes the bento using <code>bentoml containerize</code>. This vulnerability bypasses all container isolation mechanisms and gives the attacker full access to the host&rsquo;s filesystem, environment variables, and potentially other sensitive information. The lack of input validation during the import process allows the malicious template to be embedded within the bento archive undetected until the containerization process.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker crafts a malicious <code>bentofile.yaml</code> file containing a <code>dockerfile_template</code> directive pointing to a Jinja2 template with an SSTI payload.</li>
<li>The attacker builds a bento using <code>bentoml build</code>, which copies the malicious template into the bento archive at <code>env/docker/Dockerfile.template</code>.</li>
<li>The attacker exports the bento as a <code>.bento</code> or <code>.tar.gz</code> archive and distributes it to victims.</li>
<li>A victim imports the malicious bento archive using <code>bentoml import bento.tar</code>. No validation of the template content is performed during the import.</li>
<li>The victim attempts to containerize the imported bento using <code>bentoml containerize</code>, triggering the <code>construct_containerfile()</code> function.</li>
<li>The <code>construct_containerfile()</code> function detects the presence of the <code>Dockerfile.template</code> and sets the <code>dockerfile_template</code> attribute in the Docker options.</li>
<li>The <code>generate_containerfile()</code> function loads the attacker-controlled template into an unsandboxed Jinja2 environment.</li>
<li>The template is rendered, resulting in arbitrary Python code execution on the victim&rsquo;s host machine, outside of any containerized environment. This allows the attacker to achieve full host compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows arbitrary code execution on the host machine of any user who imports and containerizes the malicious bento archive. This provides the attacker with: full access to the host filesystem, the ability to install backdoors or pivot to other systems, and access to sensitive information such as credentials and API keys stored in environment variables. Due to the placement of the malicious code within a bento archive, and the nature of the containerize operation, users may be unaware of the risk and impact of this vulnerability.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the patched version of BentoML (later than 1.4.37) to remediate CVE-2026-35044.</li>
<li>Deploy the Sigma rule &ldquo;Detect BentoML SSTI Payload in Dockerfile Template&rdquo; to identify potentially malicious Jinja2 templates being written to disk.</li>
<li>Monitor process creation events for the execution of suspicious commands originating from the <code>bentoml</code> process, particularly after importing a bento archive, to catch potential exploitation attempts using the rule &ldquo;Detect Suspicious Process Execution from BentoML&rdquo;.</li>
<li>Implement strict input validation and sanitization for any user-provided templates or configuration files to prevent server-side template injection vulnerabilities, as described in the overview.</li>
<li>Review and restrict the extensions used within the Jinja2 environment to only those absolutely necessary for Dockerfile generation, following the recommended fix in the source.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>ssti</category><category>bentoml</category><category>code-execution</category><category>docker</category></item></channel></rss>