<?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>H2 (2.2.224) — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/h2-2.2.224/</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, 05 May 2026 22:15:17 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/h2-2.2.224/feed.xml" rel="self" type="application/rss+xml"/><item><title>JDBI Freemarker Template Engine Vulnerability Leads to Remote Code Execution</title><link>https://feed.craftedsignal.io/briefs/2024-01-jdbi3-freemarker-rce/</link><pubDate>Tue, 05 May 2026 22:15:17 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-jdbi3-freemarker-rce/</guid><description>Jdbi's freemarker module is vulnerable to arbitrary command execution when an application permits attacker-influenced text to reach FreemarkerEngine.parse() as template source, affecting org.jdbi:jdbi3-freemarker through version 3.52.1 and potentially leading to RCE.</description><content:encoded><![CDATA[<p>The jdbi3-freemarker library, when used with attacker-controlled template source, is vulnerable to remote code execution (RCE). This vulnerability stems from the improper neutralization of special elements used in the FreeMarker template engine. Specifically, the library&rsquo;s default configuration does not restrict Java class instantiation within FreeMarker templates, allowing attackers to instantiate arbitrary classes, including those that can execute system commands. The vulnerability affects jdbi3-freemarker versions up to and including 3.52.1. Successful exploitation requires an application to depend on the vulnerable library and permit attacker-influenced text to be used as a SQL template, either directly or indirectly through template evaluation.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies an application using jdbi3-freemarker for SQL templating.</li>
<li>The attacker discovers an endpoint where user-supplied input is incorporated into a SQL query.</li>
<li>The attacker crafts a malicious FreeMarker template payload containing a Java class instantiation that executes arbitrary commands (e.g., <code>${&quot;freemarker.template.utility.Execute&quot;?new()(&quot;touch /tmp/jdbi-pwned&quot;)}</code>).</li>
<li>The attacker injects the malicious payload into the application&rsquo;s vulnerable endpoint.</li>
<li>The application processes the attacker&rsquo;s input as a FreeMarker template using <code>FreemarkerEngine.parse()</code>.</li>
<li>Due to the lack of a <code>TemplateClassResolver</code>, FreeMarker&rsquo;s legacy <code>UNRESTRICTED_RESOLVER</code> is active, allowing the instantiation of the <code>freemarker.template.utility.Execute</code> class.</li>
<li>The <code>Execute</code> class executes the attacker&rsquo;s command, creating the <code>/tmp/jdbi-pwned</code> file on the server.</li>
<li>The attacker achieves arbitrary code execution on the server.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to execute arbitrary code within the application&rsquo;s JVM. This can lead to complete compromise of the affected system, including data theft, system modification, and denial of service. The vulnerability impacts all jdbi3-freemarker releases through version 3.52.1. Applications relying on jdbi3-freemarker and dynamically constructing SQL queries with user-controlled data are at high risk.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to a version of <code>org.jdbi:jdbi3-freemarker</code> that includes the fix described in GHSA-mggx-p7jf-jgw4 (versions &gt; 3.52.1).</li>
<li>Apply the proposed patch in <code>FreemarkerConfig.java</code> and <code>FreemarkerSqlLocator.java</code> by setting <code>TemplateClassResolver.ALLOWS_NOTHING_RESOLVER</code> to prevent arbitrary Java class instantiation by default.</li>
<li>Deploy the provided Sigma rules to your SIEM to detect potential exploitation attempts targeting this vulnerability.</li>
<li>Sanitize user-provided input before incorporating it into SQL queries to prevent injection attacks.</li>
<li>If dynamic SQL templating is required, review and restrict the classes that can be instantiated within FreeMarker templates.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>freemarker</category><category>template-injection</category><category>rce</category><category>jdbi</category></item></channel></rss>