OSV 1.4.0 · github-reviewed · 修改于 2026-06-11 21:30
发布时间
2026-05-22 04:20
GitHub 审查时间
2026-05-22 04:20
NVD 发布时间
2026-06-11 04:17
源文件
advisories/github-reviewed/2026/05/GHSA-c5fp-p67m-gq56/GHSA-c5fp-p67m-gq56.json
It impacts applications where:
It could happens with this kind of workflows:
$stylesheet = $_GET['stylesheet']; // = ‘file:///etc/passwd’
$pdf = new Knp\Snappy\Pdf(‘/usr/local/bin/wkhtmltopdf’);
$pdf->generate(‘page.html’, ‘out.pdf’, [
‘xsl-style-sheet’ => $stylesheet
]);
A list a schema with http and https by default is used to validate the remote path by default.
Developers should ensure usage cannot allow (in any case) a user to pass a free input directly to the Snappy library.
// Bad example
$pdf = new Knp\Snappy\Pdf(‘/usr/local/bin/wkhtmltopdf’);
$pdf->generate(‘page.html’, ‘out.pdf’, [
‘xsl-style-sheet’ => $_GET['input'],
]);
Instead developers can list available available stylesheets and pick the right one with the user input.
// Better
$allowedStylesheets = [
'invoice' => '/app/xsl/invoice.xsl',
'report' => '/app/xsl/report.xsl',
];
$key = $_GET['stylesheet'] ?? '';
if (!array_key_exists($key, $allowedStylesheets)) {
throw new \RuntimeException('Unknown stylesheet.');
}
$pdf = new Knp\Snappy\Pdf('/usr/local/bin/wkhtmltopdf');
$pdf->generate('page.html', 'out.pdf', [
'xsl-style-sheet' => $allowedStylesheets[$key],
]);
Read more about SSRF at owasp.org/www-community/attacks/Server_Side_Request_Forgery