Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseGHSA-679q-wc28-7wrv

GHSA-679q-wc28-7wrv: 
PHP vulnerability analysis and mitigation

Summary

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.

Details

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 - the value comes from web input the app forwards into one of these options.
  • AC:H - needs PHP 7, a phar file the attacker placed on the server (any upload, any extension) and a gadget class loaded in the app.
  • PR:N - as in GHSA-gq6w-q6wh-jggc / GHSA-92rv-4j2h-8mjj; an upload that needs a login makes it PR:L.
  • UI:N, S:U - none; stays in the PHP process.
  • C/I/A:H - object injection with a gadget chain is code execution. What would lower it:
  • Only 1.5.0+ / PHP 8 (no deserialization): 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.
  • No gadget class in the app: the phar part has no C/I/A of its own -> the same 3.7.
  • Upload needs an account: PR:L -> 7.5. We found no public caller that passes untrusted input into these options (5 checked); like CVE-2026-46683, it applies to apps that forward user input to them.

Proof of concept

Harmless, run against 1.7.3 on PHP 8.3 with a stub wkhtmltopdf that only records its arguments, in a --network none container.

  1. Plant a phar archive as /tmp/uploads/avatar.png; start a loopback "FTP" listener on 127.0.0.1:2121 that only logs the first command it gets.
  2. $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.
  3. 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.
  4. Controls: 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.

Impact


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

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-77gj-jmpx-g9fqHIGH8.1
  • PHP logoPHP
  • erugooss/erugo
NoYesNov 30, 2026
GHSA-679q-wc28-7wrvMEDIUM6.3
  • PHP logoPHP
  • knplabs/knp-snappy
NoYesNov 30, 2026
GHSA-qjgm-48mm-xm5qMEDIUM4.8
  • PHP logoPHP
  • bitpay/module-bpcheckout
NoYesNov 30, 2026
GHSA-v2m3-jwg5-vv65HIGHN/A
  • PHP logoPHP
  • tina4stack/tina4php
NoYesNov 30, 2026
GHSA-h2mr-m3v3-cq8cLOWN/A
  • JavaScript logoJavaScript
  • tina4-python
NoYesNov 30, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management