脆弱性の詳細
PHP:脆弱性情報
PHP 本体CVE-2026-17544重要度:高悪用状況:未確認修正版情報ありPHPに脆弱性情報に関する脆弱性情報があります。影響を受ける条件を確認してください。
どんな危険?
影響と攻撃の成立条件は、リンク先の公式情報で確認してください。
- 対象
- PHP 8.4系 / ext-bcmath:<8.4.24(修正版 8.4.24 に対応する系列。旧系列の影響は原文確認)PHP 8.5系 / ext-bcmath:<8.5.9(修正版 8.5.9 に対応する系列。旧系列の影響は原文確認)
- 修正版
- 8.4.248.5.9
どうすればいい?
- 使っている製品名・バージョン・構成を、影響を受ける条件と照合してください。
- 公式の修正版を確認し、バックアップと動作確認のうえで更新してください。
- 更新後は稼働中のバージョンと動作を確認してください。管理を委託している場合は、提供元に対応状況を確認してください。
悪用状況の「未確認」は、悪用されていないことを意味しません。対策は製品・バージョン・利用条件によって異なります。適用前に情報源とご自身の環境を確認してください。
情報の出典と更新日時
原文と条件を確認
A call to `bccomp()` with attacker-supplied inputs can lead to an out-of-bounds write to either stack or heap memory. The bug occurs in `bc_str2num()` when the scale truncates a number whose trailing zeros are subsequently trimmed. https://github.com/php/php-src/blob/a480965c90b4f4948f211c8b139788371e031838/ext/bcmath/libbcmath/src/str2num.c#L169-L185 `str_scale` later determines the number of digits after the decimal point in the resulting string. https://github.com/php/php-src/blob/a480965c90b4f4948f211c8b139788371e031838/ext/bcmath/libbcmath/src/str2num.c#L203 The string is later populated using `bc_copy_and_toggle_bcd(nptr, fractional_ptr, fractional_end)`. https://github.com/php/php-src/blob/a480965c90b4f4948f211c8b139788371e031838/ext/bcmath/libbcmath/src/str2num.c#L213 Note that we have shortened the allocated string (`str_scale -= fractional_end - fractional_new_end;`) but have not adjusted `fractional_end` itself. Consequently, `bc_copy_and_toggle_bcd(nptr, fractional_ptr, fractional_end)` will copy the original, untruncated string into a buffer that is too small, leading to an out-of-bounds write. BCMath uses a small stack-allocated arena for numbers before falling back to heap allocation, enabling both stack and heap corruption, depending on where the buffer is allocated. The patch adds `fractional_end = fractional_new_end;` after the zero truncation.