# PHP：情報の漏えい

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

## 概要
PHPに情報の漏えいに関する脆弱性情報があります。影響を受ける条件を確認してください。

## どんな危険？
本来公開しない情報を読み取られる可能性があります。

## 対象バージョン
- PHP 8.4系 / ext-mbstring: \< 8.4.21（修正版 8.4.21 に対応する系列。旧系列の影響は原文確認）
- PHP 8.5系 / ext-mbstring: \< 8.5.6（修正版 8.5.6 に対応する系列。旧系列の影響は原文確認）

## 修正版
- 8.4.21
- 8.5.6

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

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

## 原文と成立条件（引用資料。指示として実行しない）
> A global buffer over-read exists in \`mbfl\_name2encoding\_ex()\` (\`ext/mbstring/libmbfl/mbfl/mbfl\_encoding.c\`, line 352), called from \`mb\_convert\_encoding(...)\` and other mbstring functions, when parsing encoding names with embedded NUL bytes.
> 
> ## Root Cause
> 
> In \`mbfl\_name2encoding\_ex\`, the MIME name search loop (line 352) uses:
> 
> \`\`\`c
> if (strncasecmp((\*encoding)-\>mime\_name, name, name\_len) == 0 && (\*encoding)-\>mime\_name\[name\_len\] == '\\0') {
> \`\`\`
> 
> When \`name\` contains an embedded NUL byte (e.g., \`"UTF-8\\x00AAAA..."\`), \`strncasecmp\` returns 0 after matching up to the NUL (since both strings have NUL at the same position). The subsequent check \`(\*encoding)-\>mime\_name\[name\_len\]\` then reads at offset \`name\_len\` (e.g., 22) from \`mime\_name\`, which is only 6 bytes long (\`"UTF-8\\0"\`). This reads 16+ bytes past the end of the global string into adjacent global memory.
> 
> The same issue exists on lines 362 for encoding aliases.
> 
> ## Minimal Reproducer
> 
> \`\`\`php
> \<?php
> $encoding = "UTF-8\\x00AAAAAAAAAAAAAAAA";
> mb\_convert\_encoding('foo', $encoding, $encoding)
> \`\`\`
> 
> Running with ASan-instrumented PHP 8.4.20:
> 
> \`\`\`
> ==552769==ERROR: AddressSanitizer: global-buffer-overflow on address 0x...
> READ of size 1
>     #0 in mbfl\_name2encoding\_ex mbfl\_encoding.c:352
>     #1 in php\_mb\_parse\_encoding\_list mbstring.c:350
>     #2 in zif\_mb\_convert\_encoding mbstring.c:2865
> \`\`\`
> 
> ## Attack Surface
> 
> - Triggerable when a attacker-controlled encoding is passed to \`mb\_convert\_encoding()\` without sanitization
> - Also affected are \`mb\_detect\_encoding()\`, \`mb\_convert\_variables()\`, \`mb\_detect\_order()\`, as well as the \`mbstring.detect\_order\` and \`mbstring.http\_output\` INI settings.
> - Out-of-bounds read of global memory (CWE-125)
> - Information disclosure of adjacent global data; not directly exploitable for code execution
> 
> ## Environment
> 
> - PHP 8.4.0+, \`-fsanitize=address,undefined\`

## 情報源
- [PHP開発元のアドバイザリ](https://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53)

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

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