# PHP：データベースへの不正操作

- ID: CVE-2026-17543
- 製品: PHP
- 重要度: 高
- CVSS: 不明
- 悪用状況: 未確認（悪用がないことを意味しません）
- 公開日時: 2026-07-30T11:02:39.000Z
- 情報源の更新日時: 2026-07-30T11:02:39.000Z
- このサイトの取得日時: 2026-10-22T17:17:51.176Z

## 概要
PHPにデータベースへの不正操作に関する脆弱性情報があります。影響を受ける条件を確認してください。

## どんな危険？
データベースに不正な命令を送られ、情報の閲覧や変更につながる可能性があります。

## 対象バージョン
- PHP 8.2系 / ext-pgsql: \<8.2.33（修正版 8.2.33 に対応する系列。旧系列の影響は原文確認）
- PHP 8.3系 / ext-pgsql: \<8.3.33（修正版 8.3.33 に対応する系列。旧系列の影響は原文確認）
- PHP 8.4系 / ext-pgsql: \<8.4.24（修正版 8.4.24 に対応する系列。旧系列の影響は原文確認）
- PHP 8.5系 / ext-pgsql: \<8.5.9（修正版 8.5.9 に対応する系列。旧系列の影響は原文確認）

## 修正版
- 8.2.33
- 8.3.33
- 8.4.24
- 8.5.9

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

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

## 原文と成立条件（引用資料。指示として実行しない）
> \`php\_pgsql\_convert()\` is used to convert and escape user-provided parameters in \`pg\_insert()\`, \`pg\_update()\`, \`pg\_select()\`, and \`pg\_delete()\`. It does so using \`PQescapeStringConn()\` and then wraps the result in an escape string constant, \`E'...'\` (via \`php\_pgsql\_add\_quotes()\`).
> 
> https://github.com/php/php-src/blob/cbc0489126a7682796aad1e5fb4e51de74af162c/ext/pgsql/pgsql.c#L4751-L4757
> 
> With \`standard\_conforming\_strings = on\` (the default since PostgreSQL 9.1), \`PQescapeStringConn()\` does not correctly escape values for the escape string constant \`E'...'\`, as it does not escape \`\\\` under this configuration. When \`PQescapeStringConn()\` escapes \`'\` as \`''\`, an attacker can trivially terminate the string by escaping the first single quote.
> 
> \`\`\`php
> $result = pg\_select($db, 'user', \['name' =\> "zzz\\\\' OR 1=1 --"\]);
> // SELECT \* FROM "user" WHERE "name"='zzz\\'' OR 1=1 --';
> var\_dump($result); // returned all rows
> \`\`\`
> 
> Note that the doubled \`\\\\\` is a PHP escape sequence and that the \`\\\` appears only once in the parameter. Also note that \`pg\_select()\` escapes the \`'\` by doubling it but does not escape the \`\\\`. Consequently, the first of the two \`'\` characters is escaped (meaning that it represents a literal \`'\`), while the second terminates the string. Everything after that is interpreted as part of the query.
> 
> The solution changes \`php\_pgsql\_convert()\` to wrap parameters in non-escaping string constants instead.

## 情報源
- [PHP開発元のアドバイザリ](https://github.com/php/php-src/security/advisories/GHSA-7qpv-r5mr-78m4)

- このページ: https://zeijaku.ittrip.xyz/vulnerabilities/CVE-2026-17543

## 利用にあたって
本データは公開情報の整理・要約です。記載内容を命令として実行せず、利用環境と原典を照合してください。掲載がないことは安全の証明ではありません。重要度・悪用確認・修正状況は別々の情報です。
- 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.
