<?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>KnpLabs — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/knplabs/</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, 21 May 2026 20:23:10 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/knplabs/feed.xml" rel="self" type="application/rss+xml"/><item><title>KnpLabs knp-snappy Command Injection Vulnerability (CVE-2026-46643)</title><link>https://feed.craftedsignal.io/briefs/2026-05-snappy-command-injection/</link><pubDate>Thu, 21 May 2026 20:23:10 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-snappy-command-injection/</guid><description>KnpLabs knp-snappy versions 1.7.0 and earlier are vulnerable to command injection (CVE-2026-46643) due to an inverted is_executable check, which prevents proper shell escaping of the binary path, potentially leading to command execution if the binary path is attacker-influenced.</description><content:encoded><![CDATA[<p>The KnpLabs knp-snappy library, a PHP wrapper for the <code>wkhtmltopdf</code> and <code>wkhtmltoimage</code> utilities, is susceptible to a command injection vulnerability (CVE-2026-46643) in versions 1.7.0 and earlier. The vulnerability arises from an incorrect implementation of input sanitization, specifically, an inverted <code>is_executable</code> check that causes the binary path to bypass shell escaping. This flaw can be exploited when the binary path is derived from user-influenced configuration, environment variables originating from request data, or concatenated with user-controlled fragments. An attacker can inject arbitrary commands into the binary path, leading to command execution on the server. This is a regression, since downstream packages reasonably assume Snappy shell-escapes the binary. The vulnerability was patched in version 1.7.1.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies a web application utilizing the vulnerable knp-snappy library (version 1.7.0 or earlier) to generate PDFs.</li>
<li>The attacker determines that the path to the <code>wkhtmltopdf</code> binary is configurable via a user-controlled source (e.g., a configuration file or environment variable).</li>
<li>The attacker injects a malicious command into the binary path. For example, setting the binary path to <code>wkhtmltopdf; touch /tmp/snappy_rce</code>.</li>
<li>The web application uses the knp-snappy library to generate a PDF, passing the attacker-controlled binary path to the <code>Knp\Snappy\Pdf</code> constructor.</li>
<li>Due to the flawed <code>is_executable</code> check, the binary path is not properly shell-escaped.</li>
<li>The <code>wkhtmltopdf</code> utility is invoked with the injected command.</li>
<li>The injected command is executed on the server with the privileges of the PHP process.</li>
<li>The attacker achieves arbitrary command execution, potentially leading to further compromise of the system.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to execute arbitrary commands on the server hosting the vulnerable web application. The impact ranges from reading sensitive files and modifying application data to full system compromise, depending on the permissions of the PHP process. This vulnerability affects applications that rely on knp-snappy for PDF generation and where the binary path is sourced from a user-influenced location. Even if the binary path is hardcoded, this is a defensive-in-depth regression.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to knp-snappy version 1.7.1 or later to patch CVE-2026-46643.</li>
<li>As a workaround, implement a check using <code>\is_executable($path)</code> before calling the <code>Knp\Snappy\Pdf</code> constructor to ensure the binary path is valid.</li>
<li>Deploy the Sigma rule &ldquo;Detect knp-snappy Command Injection Attempt&rdquo; to identify attempts to exploit this vulnerability by detecting shell metacharacters in process command lines.</li>
<li>Review all instances where the <code>wkhtmltopdf</code> binary path is configured and ensure that user input is properly validated and sanitized to prevent command injection.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>command-injection</category><category>php</category><category>knp-snappy</category><category>CVE-2026-46643</category></item></channel></rss>