Skip to main content

KnpLabs Snappy CVE-2026-46683

| EUVDEUVD-2026-36112 MEDIUM
Server-Side Request Forgery (SSRF) (CWE-918)
2026-05-21 https://github.com/KnpLabs/snappy GHSA-c5fp-p67m-gq56
6.9
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
    Send HTTP request with file:// URI as stylesheet param
  2. Delivery
    Application passes unsanitized input to Snappy xsl-style-sheet option
  3. Exploit
    Snappy forwards URI to wkhtmltopdf binary
  4. Execution
    wkhtmltopdf reads target local file via file:// scheme
  5. Persist
    File contents embedded in generated PDF output
  6. Impact
    Attacker 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.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

AnalysisAIv1 – 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

snappy < 1.7.0

Affected Packages

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

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

Vendor (https://github.com/KnpLabs/snappy) PRIMARY 6.9 MEDIUM
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

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

Lifecycle Timeline

1
CVSS changed
Jun 10, 2026 - 20:22 NVD
6.9 (MEDIUM)

DescriptionCVE.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:

php
$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.

php
// 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.

php
// 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

EPSS Score
0.0%
Top 87% 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

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

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

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