Snappy: Binary path is never shell-escaped due to an inverted is_executable check
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-78.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| KnpLabs | snappy | before 1.7.1 | 1.7.1 | Patch available | CNA |
| — | KnpLabs/knp-snappy (Packagist) | before 1.7.1 | 1.7.1 | Patch available | GHSA-vpr4-p6fq-85jc |
- snappy VendorKnpLabs Affected before 1.7.1 Fixed in 1.7.1 Patch available CNA
- KnpLabs/knp-snappy (Packagist) Vendor— Affected before 1.7.1 Fixed in 1.7.1 Patch available GHSA-vpr4-p6fq-85jc
Remediation
- Fix · CNA snappy (KnpLabs) Fixed in 1.7.1
- Fix · GHSA-vpr4-p6fq-85jc KnpLabs/knp-snappy (Packagist) Fixed in 1.7.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-46643
- 2026-10-03 Alias added: GHSA-vpr4-p6fq-85jc
References
More KnpLabs vulnerabilities
- TI-2023-21930 Unsafe deserialization in knplabs/knp-snappy CVSS 3.1CRITICAL 9.8
- TI-2023-12694 Snappy vulnerable to PHAR deserialization, allowing remote code execution CVSS 3.1CRITICAL 9.8
- TI-2026-34314 Snappy: SSRF and local file read via the xsl-style-sheet option CVSS 4.0MEDIUM 6.9
Sources
- CVE-2026-46643 · CVE Program
- CVE-2026-46643 · NVD
- FIRST EPSS
- GHSA-vpr4-p6fq-85jc · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences