Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-wm6j-2649-pv75

Опубликовано: 07 мая 2026
Источник: github
Github: Не прошло ревью

Описание

Null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()

The following PHP code triggers a segmentation fault due to a NULL pointer dereference:

<?php mb_regex_encoding('iso-8859-11'); $test_str = 'x'; if (mb_ereg_search_init($test_str)) { $val = mb_ereg_search_pos("x"); var_dump($val); } else { var_dump(false); }

The crash occurs due to a mismatch between Oniguruma and mbfl encoding support:

  1. Oniguruma (the regex library) supports iso-8859-11 (Thai encoding)
  2. mbfl (mbstring's internal encoding library) does NOT support iso-8859-11

https://github.com/php/php-src/blob/0d9ff00394d9447992bb66ccb1cef3edf70576bd/ext/mbstring/php_mbregex.c#L404-L413

When mb_regex_encoding('iso-8859-11') is called:

  • php_mb_regex_set_mbctype() validates the encoding against Oniguruma → succeeds
  • mbfl_name2encoding('iso-8859-11') is called → returns NULL
  • MBREX(current_mbctype_mbfl_encoding) is set to NULL

Later, when mb_ereg_search_init() calls php_mb_check_encoding():

  • php_mb_regex_get_mbctype_encoding() returns NULL
  • php_mb_check_encoding() dereferences the NULL pointer → SEGV

This vulnerability allows a denial of service (DoS). An attacker can reliably crash a PHP process when user-controlled input influences the encoding passed to mb_regex_encoding() and the application subsequently uses mbregex search APIs.

Enumeration of all Oniguruma-supported encodings vs mbfl support:

Encoding / aliasesOnigurumambflStatus
iso-8859-1 … iso-8859-10Safe
iso-8859-11, ISO8859-11CRASH
iso-8859-13 … iso-8859-16Safe
EUC-JP aliases: UJISCRASH
EUC-CN aliases: GB-2312CRASH
KOI8 aliases: KOI-8RCRASH
ASCII aliases: US_ASCII, ISO646CRASH
KOI8 (no suffix)Safe (rejected by mb_regex_encoding())
All other encodingsSafe

Credits

Viet Hoang Luu - The University of Melbourne Amirmohammad Pasdar - The University of Melbourne Wachiraphan Charoenwet - The University of Melbourne Shaanan Cohney - The University of Melbourne Toby Murray - The University of Melbourne Van-Thuan Pham - The University of Melbourne

Пакеты

Наименование

php

php
Затронутые версииВерсия исправления

>=8.5.0, <8.5.6

8.5.6

Наименование

php

php
Затронутые версииВерсия исправления

>=8.4.0, <8.4.21

8.4.21

Наименование

php

php
Затронутые версииВерсия исправления

>=8.3.0, <8.3.31

8.3.31

Наименование

php

php
Затронутые версииВерсия исправления

>=8.2.0, <8.2.31

8.2.31

EPSS

Процентиль: 10%
0.00202
Низкий

Дефекты

CWE-476

Связанные уязвимости

CVSS3: 6.5
ubuntu
3 месяца назад

In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before 8.4.21, and 8.5.* before 8.5.6, a mismatch between encoding lists in Oniguruma and mbfl leads to  a NULL pointer dereference, resulting in a segmentation fault and denial of service. The vulnerability is exploitable when user-controlled input can influence the encoding passed to mb_regex_encoding().

CVSS3: 6.5
redhat
3 месяца назад

In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before 8.4.21, and 8.5.* before 8.5.6, a mismatch between encoding lists in Oniguruma and mbfl leads to  a NULL pointer dereference, resulting in a segmentation fault and denial of service. The vulnerability is exploitable when user-controlled input can influence the encoding passed to mb_regex_encoding().

CVSS3: 6.5
nvd
3 месяца назад

In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before 8.4.21, and 8.5.* before 8.5.6, a mismatch between encoding lists in Oniguruma and mbfl leads to  a NULL pointer dereference, resulting in a segmentation fault and denial of service. The vulnerability is exploitable when user-controlled input can influence the encoding passed to mb_regex_encoding().

msrc
3 месяца назад

Null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()

CVSS3: 6.5
debian
3 месяца назад

In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before ...

EPSS

Процентиль: 10%
0.00202
Низкий

Дефекты

CWE-476