CVE-2026-46643 Details
Description
Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Prior to version 1.7.1, on POSIX, escapeshellarg(‘/usr/bin/wkhtmltopdf’) returns the literal string ‘/usr/bin/wkhtmltopdf’ with the single-quote characters included. is_executable() then looks for a file whose actual name contains those quote characters, which essentially never exists. The safe branch is dead code and $command always falls through to the raw, unescaped value. The rest of the arguments (options, input, output) are escaped correctly, so injection has to land in the binary string itself. That happens whenever the binary path is sourced from configuration that is user-influenced, derived from environment variables that ultimately come from request data, or concatenated with any user-controlled fragment. This issue has been patched in version 1.7.1.
A vulnerability in KnpLabs Snappy versions through 1.7.0 allows for command injection via the binary string argument. On POSIX systems, the function escapeshellarg incorrectly includes single quotes in the escaped string, which is then interpreted literally by is_executable(). This misalignment allows the command execution to bypass intended safety measures, especially when the binary path is influenced by user data or environment variables. The issue arises because the library fails to properly escape the binary path before execution, creating a vector for injection.
Users can upgrade to KnpLabs Snappy version 1.7.1 or later, which addresses this vulnerability by ensuring the binary path is properly escaped before execution. Alternatively, users can manually check that the binary path is executable before passing it to the Pdf constructor.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jun 10, 2026CISA-ADP
Assessed Jun 11, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc | CISA-ADP | AdvisoryExploitRemedyVendor |
| https://github.com/KnpLabs/snappy/releases/tag/v1.7.1 | [email protected] | Release NotesVendor |
| https://github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc | [email protected] | AdvisoryExploitRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| KnpLabs Snappy | <= 1.7.0 (semver) |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 11, 2026 | CVE Modified | CISA-ADP |
| Jun 10, 2026 | New CVE Received | [email protected] |
Volerion