WizがGoogle Cloudに参加:共に魔法を作り出す
脆弱性データベースGHSA-679q-wc28-7wrv

GHSA-679q-wc28-7wrv: 
PHP 脆弱性分析と緩和策

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 :)


ソース: NVD

関連 PHP 脆弱性:

CVE ID

重大度

スコア

テクノロジー

コンポーネント名

CISA KEVのエクスプロイト

修正あり

出版日

GHSA-77gj-jmpx-g9fqHIGH8.1
  • PHP logoPHP
  • erugooss/erugo
いいえはいNov 30, 2026
GHSA-679q-wc28-7wrvMEDIUM6.3
  • PHP logoPHP
  • knplabs/knp-snappy
いいえはいNov 30, 2026
GHSA-qjgm-48mm-xm5qMEDIUM4.8
  • PHP logoPHP
  • bitpay/module-bpcheckout
いいえはいNov 30, 2026
GHSA-v2m3-jwg5-vv65HIGH該当なし
  • PHP logoPHP
  • tina4stack/tina4php
いいえはいNov 30, 2026
GHSA-h2mr-m3v3-cq8cLOW該当なし
  • JavaScript logoJavaScript
  • tina4-python
いいえはいNov 30, 2026

無料脆弱性評価

クラウドセキュリティの姿勢をベンチマークしましょう

9つのセキュリティ領域にわたるクラウドセキュリティの実践を評価し、リスクレベルをベンチマークし、防御のギャップを特定しましょう。

評価のリクエスト

Wizのその他のリソース

パーソナライズされたデモを見る

実際に Wiz を見てみませんか?​

"私が今まで見た中で最高のユーザーエクスペリエンスは、クラウドワークロードを完全に可視化します。"
デビッド・エストリックCISO (最高情報責任者)
"Wiz を使えば、クラウド環境で何が起こっているかを 1 つの画面で確認することができます"
アダム・フレッチャーチーフ・セキュリティ・オフィサー
"Wizが何かを重要視した場合、それは実際に重要であることを私たちは知っています。"
グレッグ・ポニャトフスキ脅威および脆弱性管理責任者