{"id":"CVE-2026-46683","aliases":["EUVD-2026-36112","GHSA-c5fp-p67m-gq56"],"status":"published","title":"Snappy: SSRF and local file read via the xsl-style-sheet option","description":"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.","severity":{"version":"4.0","score":6.9,"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","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00249,"percentile":0.16297,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-918"],"published":"2026-05-21T20:20:01Z","modified":"2026-10-28T02:30:35Z","fixes":[{"ecosystem":"Packagist","package":"knplabs/knp-snappy","fixed_in":["1.7.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"knplabs/knp-snappy","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.6.0"},{"fixed":"1.7.0"}]}]},{"source":"osv","ecosystem":"Packagist","package":"knplabs/knp-snappy","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.7.0"}]}],"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"]}],"products":[{"vendor":"knplabs","product":"snappy"}],"references":[{"url":"https://github.com/KnpLabs/snappy/security/advisories/GHSA-c5fp-p67m-gq56","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/KnpLabs/snappy/releases/tag/v1.7.0","tags":["x_refsource_MISC","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46683","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-c5fp-p67m-gq56"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46683.json","tags":["advisory"]},{"url":"https://github.com/KnpLabs/snappy","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-46683","title":"Snappy: SSRF and local file read via the xsl-style-sheet option","description":"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.","status":"published","published":"2026-06-10T19:53:09.02Z","modified":"2026-06-11T14:06:14.719Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium","assessor":"cna"}],"cwes":["CWE-918"],"updated_at":"2026-11-02T13:47:06.353366Z"}],"euvd":[{"id":"EUVD-2026-36112","description":"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.","status":"published","published":"2026-06-10T19:53:09Z","modified":"2026-06-11T14:06:14Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium"}],"updated_at":"2026-11-02T18:20:44.570445Z"}],"ghsa":[{"id":"GHSA-c5fp-p67m-gq56","title":"Snappy : SSRF and local file read via the xsl-style-sheet option","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-\u003egenerate(‘page.html’, ‘out.pdf’, [\n   ‘xsl-style-sheet’ =\u003e $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-\u003egenerate(‘page.html’, ‘out.pdf’, [\n   ‘xsl-style-sheet’ =\u003e $_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' =\u003e '/app/xsl/invoice.xsl',\n    'report'  =\u003e '/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-\u003egenerate('page.html', 'out.pdf', [\n    'xsl-style-sheet' =\u003e $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)","status":"published","published":"2026-05-21T20:20:01Z","modified":"2026-06-11T13:30:22Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium"}],"cwes":["CWE-918"],"updated_at":"2026-11-02T14:40:26.12116Z"}],"nvd":[{"id":"CVE-2026-46683","description":"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.","status":"published","published":"2026-06-10T20:17:29.017Z","modified":"2026-10-25T23:10:00.167Z","cvss":[{"version":"4.0","score":6.9,"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","assessor":"secondary"}],"cwes":["CWE-918"],"updated_at":"2026-11-02T14:12:23.485267Z"}],"osv":[{"id":"CVE-2026-46683","title":"Snappy: SSRF and local file read via the xsl-style-sheet option","description":"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.","status":"published","published":"2026-06-10T19:53:09.02Z","modified":"2026-10-28T02:30:35.706835421Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium"}],"cwes":["CWE-918"],"updated_at":"2026-11-02T15:45:06.231145Z"},{"id":"GHSA-c5fp-p67m-gq56","title":"Snappy : SSRF and local file read via the xsl-style-sheet option","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-\u003egenerate(‘page.html’, ‘out.pdf’, [\n   ‘xsl-style-sheet’ =\u003e $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-\u003egenerate(‘page.html’, ‘out.pdf’, [\n   ‘xsl-style-sheet’ =\u003e $_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' =\u003e '/app/xsl/invoice.xsl',\n    'report'  =\u003e '/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-\u003egenerate('page.html', 'out.pdf', [\n    'xsl-style-sheet' =\u003e $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)","status":"published","published":"2026-05-21T20:20:01Z","modified":"2026-09-10T03:50:46.558387018Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium"}],"cwes":["CWE-918"],"updated_at":"2026-11-02T15:46:44.571161Z"}]}}
