
Cloud Vulnerability DB
A community-led vulnerabilities database
Re-submitting here the report I mailed to security@knplabs.com on 2026-11-30, as you asked.
Pdf::handleOptions() (src/Knp/Snappy/Pdf.php:68) calls isFile() -> is_file() (AbstractGenerator.php:720) on every xsl-style-sheet, header-html, footer-html and cover value before any scheme check. is_file() resolves PHP stream wrappers: a phar:// value makes PHP parse the archive (on PHP 7 that unserializes its metadata - the same primitive as CVE-2023-28115 / CVE-2023-41330, through a different entry point), and an ftp:// value opens a connection, even when the app restricted $allowedSchemes (CVE-2026-46683's fix). The output filename (isProtocolAllowed()) and the xsl fetch (isOptionUrl()) are guarded; this probe is not.
Affected: every tag from 0.4 to 1.7.3 and master @ f749a7d (checked by source; 0.1.0-0.3.4 not checked). The object-injection part needs PHP < 8, so it applies to 1.4.4 and older; 1.5.0+ require PHP 8.1, where only the outbound-connection part remains.
handleOptions() does $saveToTempFile = !$this->isFile($value) && !$this->isOptionUrl($value);, and isFile() only checks the length before is_file(). For xsl-style-sheet => 'phar:///uploads/avatar.png/x' PHP opens the planted archive; is_file() returns true and the raw phar:// string is passed to wkhtmltopdf as a file. For ftp://host:port/x PHP connects to that host during the stat, then (stat failed) saves the string as content. The scheme allow-lists added for the output filename (1.4.2/1.4.3) and for the xsl fetch (1.7.0) never see this call.
Severity reasons (our estimate - your rating wins):
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N 3.7 Low - a blind outbound FTP connection to any host:port and a "does this file exist on that FTP server" answer, despite allowedSchemes.Harmless, run against 1.7.3 on PHP 8.3 with a stub wkhtmltopdf that only records its arguments, in a --network none container.
/tmp/uploads/avatar.png; start a loopback "FTP" listener on 127.0.0.1:2121 that only logs the first command it gets.$pdf->generate('in.html', '/tmp/out.pdf', ['xsl-style-sheet' => 'phar:///tmp/uploads/avatar.png/inner.txt']) -> the stub receives --xsl-style-sheet phar:///tmp/uploads/avatar.png/inner.txt, i.e. is_file() opened the archive. Same for header-html with PHAR:// and for cover.new Pdf($bin, [], null, []) (no URL scheme allowed) and ['xsl-style-sheet' => 'ftp://127.0.0.1:2121/probe.xsl'] -> the listener logs USER anonymous. Same for footer-html with the default schemes.PHAR://... and ftp://... as the output filename are refused by isProtocolAllowed() with no connection; http://127.0.0.1:2121/... with allowedSchemes [] makes no connection (http has no stat); a plain local XSL path is passed through as before.
On PHP 8.3 the phar metadata is not unserialized (expected, PHP 8.0 change); the PHP 7 part was not run through the library (no PHP 7 image in our sandbox) - it rests on PHP 7's documented stat behaviour, the same one your 2023 advisories cover. No gadget chain was built or tested.xsl-style-sheet, header-html, footer-html or cover: on PHP 7 (knp-snappy <= 1.4.4) PHAR metadata deserialization of an uploaded file, code execution with a gadget class; on PHP 8 (1.5.0+) a blind outbound FTP connection and file-exists probe despite allowedSchemes.
Fix: a signed commit with tests is ready on top of master; I will push it to this advisory's temporary private fork and open a PR there. In short: a scheme-prefixed value (<scheme>://, so C:\ never matches) only reaches isFile() when the scheme is file or in $allowedSchemes; any other is handled as content. 9 new tests fail before / pass after, 6 accepted-case tests pass before and after; PHPUnit (PHP 8.3, 8.4), phpstan and php-cs-fixer clean. Not run: PHP 8.1/8.2/8.5, the Symfony matrix, Windows.
Behaviour change (release notes): an existing phar://, ftp:// (not allowed), compress.zlib:// ... value is no longer passed to wkhtmltopdf as a file; it is written to a temporary file as content. An app that wants wkhtmltopdf to read ftp:// adds ftp to $allowedSchemes.
Still open from the mail: is 1.4.x (listed as supported in SECURITY.md) getting a release, or is it end of life?Issue found and fixed by Claude, reproduced issue in an isolated container, then reviewed and confirmed by Ief (GitHub: iefken). Full disclosure from my end: I am in my 'starter'-steps in learning how to find and report these kinds of bugs/issue's with the help from my (spare-) AI (-usage tokens), so any feedback is greatly appreciated aswell :)
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."