{"id":"GHSA-c5fp-p67m-gq56","aliases":["CVE-2026-46683"],"title":"Snappy : SSRF and local file read via the xsl-style-sheet option","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"### 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":"medium","score":6.9,"published":"2026-05-21T20:20:01.000Z","modified":"2026-09-10T03:50:46.558Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Packagist","name":"knplabs/knp-snappy","sources":[{"name":"OSV · GHSA-c5fp-p67m-gq56","url":"https://osv.dev/vulnerability/GHSA-c5fp-p67m-gq56"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"1.7.0"}],"type":"ECOSYSTEM"}],"versions":["0.1.0","0.1.1","0.1.2","0.2.0","0.2.1","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.4","0.4.1","0.4.2","0.4.3","v0.5.0","v1.0","v1.0.1","v1.0.2","v1.0.3","v1.0.4","v1.1.0","v1.2.0","v1.2.1","v1.3.0","v1.3.1","v1.4.0","v1.4.1","v1.4.2","v1.4.3","v1.4.4","v1.5.0","v1.5.1","v1.6.0"],"fixed":["1.7.0"]}],"sourceAffected":[],"references":["https://github.com/KnpLabs/snappy/security/advisories/GHSA-c5fp-p67m-gq56","https://nvd.nist.gov/vuln/detail/CVE-2026-46683","https://github.com/KnpLabs/snappy","https://github.com/KnpLabs/snappy/releases/tag/v1.7.0"],"sources":[{"name":"OSV","id":"GHSA-c5fp-p67m-gq56","modified":"2026-09-10T03:50:46.558387018Z","url":"https://osv.dev/vulnerability/GHSA-c5fp-p67m-gq56"}],"assessments":[{"source":"OSV","vector":"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","score":6.9}],"products":[],"remediation":[],"kev":{"status":"not-listed","checkedAt":"2026-10-28T22:15:33.378Z"},"coverage":[{"source":"NVD","status":"not-checked"},{"source":"GHSA","status":"not-checked"},{"source":"EUVD","status":"not-checked"},{"source":"EPSS","status":"not-checked"}],"evidence":[]}