CVE-2026-46683: Snappy SSRF And Local File Read Vulnerability
MODERATECVE-2026-46683 is a MODERATE ssrf and local file read vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Snappy libraries in the Packagist ecosystem. The issue involves ssrf and local file read via the xsl-style-sheet option. Remediation is available by upgrading affected packages to version 1.7.0.
CVE-2026-46683 at a Glance
How to Fix CVE-2026-46683
To remediate this vulnerability, upgrade all affected Snappy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade knplabs/knp-snappy to 1.7.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for knplabs/knp-snappy
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-46683, inspect your project dependencies for Snappy:
inspect dependencies for knplabs/knp-snappy
Analyze the terminal output to locate any version of Snappy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Snappy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-46683 Affected Snappy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
knplabs/knp-snappy
|
Packagist |
< 1.7.0
|
1.7.0
|
References
Frequently Asked Questions
What is CVE-2026-46683?
Which Snappy versions are affected?
What version fixes CVE-2026-46683?
Is knplabs/knp-snappy affected?
What CWE is associated with CVE-2026-46683?
How can I check Packagist dependencies for CVE-2026-46683?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c5fp-p67m-gq56",
"modified" : "2026-06-11T13:30:20Z",
"published" : "2026-05-21T20:20:01Z",
"aliases" : [ "CVE-2026-46683" ],
"summary" : "Snappy : SSRF and local file read via the xsl-style-sheet option",
"details" : "### Impact\n\nIt impacts applications where:\n- the PHP daemon run with root permissions ;\n- the application is either running outside a container or has sensitive file access ;\n\nIt could happens with this kind of workflows:\n\n```php\n$stylesheet = $_GET['stylesheet']; // = ‘file:///etc/passwd’\n$pdf = new Knp\\Snappy\\Pdf(‘/usr/local/bin/wkhtmltopdf’);\n $pdf->generate(‘page.html’, ‘out.pdf’, [\n ‘xsl-style-sheet’ => $stylesheet\n ]);\n```\n\n### Patches\n\nA list a schema with `http` and `https` by default is used to validate the remote path by default.\n\n### Workarounds\n\nDevelopers should ensure usage cannot allow (in any case) a user to pass a free input directly to the Snappy library.\n\n```php\n// Bad example\n$pdf = new Knp\\Snappy\\Pdf(‘/usr/local/bin/wkhtmltopdf’);\n $pdf->generate(‘page.html’, ‘out.pdf’, [\n ‘xsl-style-sheet’ => $_GET['input'],\n ]);\n```\n\nInstead developers can list available available stylesheets and pick the right one with the user input.\n\n```php\n// Better\n$allowedStylesheets = [\n 'invoice' => '/app/xsl/invoice.xsl',\n 'report' => '/app/xsl/report.xsl',\n];\n\n$key = $_GET['stylesheet'] ?? '';\n\nif (!array_key_exists($key, $allowedStylesheets)) {\n throw new \\RuntimeException('Unknown stylesheet.');\n}\n\n$pdf = new Knp\\Snappy\\Pdf('/usr/local/bin/wkhtmltopdf');\n$pdf->generate('page.html', 'out.pdf', [\n 'xsl-style-sheet' => $allowedStylesheets[$key],\n]);\n```\n\n### References\n\nRead more about SSRF at [owasp.org/www-community/attacks/Server_Side_Request_Forgery](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "knplabs/knp-snappy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.7.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.6.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/KnpLabs/snappy/security/advisories/GHSA-c5fp-p67m-gq56"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-46683"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/KnpLabs/snappy"
}, {
"type" : "WEB",
"url" : "https://github.com/KnpLabs/snappy/releases/tag/v1.7.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-21T20:20:01Z",
"nvd_published_at" : "2026-06-10T20:17:29Z"
}
}