Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend HTTP request with file:// URI as stylesheet param
-
DeliveryApplication passes unsanitized input to Snappy xsl-style-sheet option
-
ExploitSnappy forwards URI to wkhtmltopdf binary
-
Executionwkhtmltopdf reads target local file via file:// scheme
-
PersistFile contents embedded in generated PDF output
-
ImpactAttacker retrieves PDF and extracts sensitive file data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Credential Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the application passes user-controlled input directly to the xsl-style-sheet option of Snappy's generate() method without URI schema validation or allowlist enforcement. The knplabs/knp-snappy version must be <= 1.6.0. Impact severity is amplified - but not gated - by the PHP daemon running with root privileges and the application running outside a container or with broad filesystem read access. Exploitation is limited by: (1) any application-level input validation or stylesheet allowlisting that prevents arbitrary URI injection; (2) PHP process running as an unprivileged user, which limits the set of readable files; (3) container isolation with a restricted filesystem, which reduces the value of local file read. Authentication requirements are not confirmed from available data, as no CVSS vector was provided - exploitation depends entirely on whether the application endpoint invoking Snappy is publicly accessible or protected. |
| Impact | No CVSS vector is provided for this CVE, which limits automated risk scoring. Based on the description and CWE-918, the attack vector is network (an attacker sends a crafted HTTP request), complexity is low (no special skill required beyond passing a URL string), and no authentication is inherently required by the vulnerability itself - though the application's own authentication layer may restrict access. The vulnerability is not listed in CISA KEV and no POC has been confirmed in the available data. Despite the absence of CVSS and KEV signals, real-world risk is substantial in deployments where: (1) the PHP process runs as root, and (2) the application operates outside a container with broad filesystem access. In such configurations, a successful exploit yields full local file read access, which can expose credentials, private keys, and application secrets. In hardened deployments (non-root PHP, container isolation, no direct user input to Snappy), practical risk is significantly reduced. The lack of CVSS data is a gap - defenders should not interpret the absence of a score as low risk. |
| Exploit ScenarioDerived | An attacker targeting a web application that generates PDFs via Snappy issues an HTTP GET request such as GET /generate-pdf?stylesheet=file:///etc/passwd. The application passes this value directly to Snappy's xsl-style-sheet option, which forwards it to wkhtmltopdf. The wkhtmltopdf binary resolves the file:// URI, reads the local file, and incorporates its contents into the generated PDF, which is then returned to the attacker. If the PHP process runs as root, this technique can be extended to read any file on the host, including private SSH keys, application .env files with database credentials, or cloud metadata endpoint responses if network-reachable URIs are also passed. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 21, 2026
Server-Side Request Forgery (SSRF) and local file read in KnpLabs Snappy (composer package knplabs/knp-snappy <= 1.6.0) allows remote attackers to exfiltrate sensitive server files by injecting a file:// URI into the xsl-style-sheet PDF generation option. When applications pass unsanitized user input directly to the Snappy library's generate() method, wkhtmltopdf processes attacker-controlled URIs including file:// scheme paths, enabling reads of files such as /etc/passwd. No public exploit has been identified at time of analysis, and this is not listed in CISA KEV, but the attack pattern is straightforward and exploitability is high in vulnerable deployments where PHP runs as root outside a container.
RemediationAI
Upgrade knplabs/knp-snappy to version 1.7.0 or later via Composer (composer require knplabs/knp-snappy:^1.7.0). Version 1.7.0 introduces a URI schema allowlist restricted to http and https by default, blocking file:// and other dangerous schemes before they reach wkhtmltopdf. As an application-level workaround where immediate patching is not possible, developers must never pass raw user input to the xsl-style-sheet option or any other Snappy option that accepts file or URI paths. Instead, implement a server-side allowlist mapping user-supplied keys to pre-approved absolute filesystem paths (e.g., mapping 'invoice' to '/app/xsl/invoice.xsl') and reject any key not present in the allowlist with a hard error. Note: this workaround requires code changes across all call sites and carries the operational risk of missing undiscovered call paths - patching to 1.7.0 is strongly preferred. The advisory and example code are at https://github.com/KnpLabs/snappy/security/advisories/GHSA-c5fp-p67m-gq56.
Affected VersionsENISA
Affected Packages
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
KnpLabs Snappy is a PHP wrapper library around the wkhtmltopdf binary, used to generate PDFs and images from HTML. The affected component is the xsl-style-sheet option passed through Snappy's generate() method, which is forwarded as a command-line argument to wkhtmltopdf. The wkhtmltopdf binary supports multiple URI schemes including file://, which allows it to read local filesystem paths during XSL stylesheet processing. The root cause (CWE-918: Server-Side Request Forgery) is the absence of URI schema validation in Snappy prior to version 1.7.0 - user-supplied input could specify arbitrary URI schemes without restriction. The affected Composer package is pkg:composer/knplabs_knp-snappy, versions <= 1.6.0. The fix in 1.7.0 introduces a schema allowlist defaulting to http and https, blocking file://, ftp://, and other potentially dangerous schemes.
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
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:L/SA:N
Primary rating from Vendor (https://github.com/KnpLabs/snappy) · only source for this CVE.
CVSS VectorVendor: https://github.com/KnpLabs/snappy
Lifecycle Timeline
1DescriptionCVE.org
Impact
It impacts applications where:
- the PHP daemon run with root permissions ;
- the application is either running outside a container or has sensitive file access ;
It could happens with this kind of workflows:
$stylesheet = $_GET['stylesheet']; // = ‘file:///etc/passwd’
$pdf = new Knp\Snappy\Pdf(‘/usr/local/bin/wkhtmltopdf’);
$pdf->generate(‘page.html’, ‘out.pdf’, [
‘xsl-style-sheet’ => $stylesheet
]);Patches
A list a schema with http and https by default is used to validate the remote path by default.
Workarounds
Developers should ensure usage cannot allow (in any case) a user to pass a free input directly to the Snappy library.
// Bad example
$pdf = new Knp\Snappy\Pdf(‘/usr/local/bin/wkhtmltopdf’);
$pdf->generate(‘page.html’, ‘out.pdf’, [
‘xsl-style-sheet’ => $_GET['input'],
]);Instead developers can list available available stylesheets and pick the right one with the user input.
// Better
$allowedStylesheets = [
'invoice' => '/app/xsl/invoice.xsl',
'report' => '/app/xsl/report.xsl',
];
$key = $_GET['stylesheet'] ?? '';
if (!array_key_exists($key, $allowedStylesheets)) {
throw new \RuntimeException('Unknown stylesheet.');
}
$pdf = new Knp\Snappy\Pdf('/usr/local/bin/wkhtmltopdf');
$pdf->generate('page.html', 'out.pdf', [
'xsl-style-sheet' => $allowedStylesheets[$key],
]);References
Read more about SSRF at owasp.org/www-community/attacks/Server_Side_Request_Forgery
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.
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
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
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
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
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
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
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
EUVD-2026-36112
GHSA-c5fp-p67m-gq56
NVD
CVE.org
EPSS
VulDB
Exploit-DB