{"id":"CVE-2026-46683","aliases":["GHSA-c5fp-p67m-gq56"],"url":"https://o3.security/vulnerability/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)","published":"2026-06-10T19:53:09.020Z","modified":"2026-08-12T03:51:46.352947085Z","cvss":null,"epss":{"score":0.00249,"percentile":0.15957,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"knplabs/knp-snappy","fixedVersion":"1.7.0"}],"fix":null,"references":[{"type":"WEB","url":"https://github.com/KnpLabs/snappy/releases/tag/v1.7.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46683.json"},{"type":"ADVISORY","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"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:46.352947085Z"}}