{"id":"CVE-2026-46683","aliases":["CVE-2026-46683","GHSA-c5fp-p67m-gq56"],"related":["CVE-2026-49359"],"kind":"vulnerability","state":"published","title":"Snappy: SSRF and local file read via the xsl-style-sheet option","summary":"Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Prior to version 1.7.0, there is a SSRF and local file read vulnerability via the xsl-style-sheet option. This issue has been patched in version 1.7.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Prior to version 1.7.0, there is a SSRF and local file read vulnerability via the xsl-style-sheet option. This issue has been patched in version 1.7.0.","source":"cvelist"},{"lang":"en","text":"### 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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Snappy es una biblioteca PHP que permite la generación de miniaturas, instantáneas o PDF a partir de una URL o una página HTML. Antes de la versión 1.7.0, existe una vulnerabilidad de SSRF y lectura de archivos locales a través de la opción xsl-style-sheet. Este problema ha sido parcheado en la versión 1.7.0.","source":"nvd"}],"published":"2026-05-21T20:20:01.000Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","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,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","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,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":"< 1.7.0","status":"affected"}],"vendor":"KnpLabs","product":"snappy","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.7.0"}],"ecosystem":"Packagist","package":"knplabs/knp-snappy","purl":"pkg:composer/knplabs/knp-snappy","source":"ghsa"}],"references":[{"url":"https://github.com/KnpLabs/snappy/security/advisories/GHSA-c5fp-p67m-gq56","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/KnpLabs/snappy/releases/tag/v1.7.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46683","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/KnpLabs/snappy","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-06-11T14:05:06.327Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46683","url":"https://www.cve.org/CVERecord?id=CVE-2026-46683","licence":"CVE Terms of Use","modified":"2026-06-11T14:06:14.719Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c5fp-p67m-gq56","url":"https://github.com/advisories/GHSA-c5fp-p67m-gq56","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:46.558Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46683","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46683","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"}],"updatedAt":"2026-11-25T22:59:24.361Z","epss":{"score":0.00421,"percentile":0.28151,"date":"2026-11-30T12:00:22.000Z"}}