{"vuln_id":"GHSA-wm6j-2649-pv75","aliases":["CVE-2026-7259"],"description":"Null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()","published_at":"2026-05-07T12:57:13Z","modified_at":"2026-05-07T12:57:13Z","first_seen_at":"2026-11-22T14:05:37.609023Z","severity":"low","severity_source":"ghsa","cvss_score":null,"cvss_vector":null,"cwe":["CWE-476"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-wm6j-2649-pv75"},"matched_alias":null,"items":[{"id":12641,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-wm6j-2649-pv75 / CVE-2026-7259: Null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()","summary":"Null pointer dereference in php_mb_check_encoding() via mb_ereg_search_init()\n\nThe following PHP code triggers a segmentation fault due to a NULL pointer dereference:\r\n\r\n```php\r\n<?php\r\nmb_regex_encoding('iso-8859-11');\r\n$test_str = 'x';\r\n\r\nif (mb_ereg_search_init($test_str)) {\r\n    $val = mb_ereg_search_pos(\"x\");\r\n    var_dump($val);\r\n} else {\r\n    var_dump(false);\r\n}\r\n```\r\n\r\nThe crash occurs due to a mismatch between Oniguruma and mbfl encoding support:\r\n\r\n1. **Oniguruma** (the regex library) supports `iso-8859-11` (Thai encoding)\r\n2. **mbfl** (mbstring's internal encoding library) does **NOT** support `iso-8859-11`\r\n\r\nhttps://github.com/php/php-src/blob/0d9ff00394d9447992bb66ccb1cef3edf70576bd/ext/mbstring/php_mbregex.c#L404-L413\r\n\r\nWhen `mb_regex_encoding('iso-8859-11')` is called:\r\n- `php_mb_regex_set_mbctype()` validates the encoding against Oniguruma → **succeeds**\r\n- `mbfl_name2encoding('iso-8859-11')` is called → returns **NULL**\r\n- `MBREX(current_mbctype_mbfl_encoding)` is set to **NULL**\r\n\r\nLater, when `mb_ereg_search_init()` calls `php_mb_check_encoding()`:\r\n- `php_mb_regex_get_mbctype_encoding()` returns NULL\r\n- `php_mb_check_encoding()` dereferences the `NULL` pointer → **SEGV**\r\n\r\nThis 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.\r\n\r\nEnumeration of all Oniguruma-supported encodings vs mbfl support:\r\n\r\n| Encoding / aliases | Oniguruma | mbfl | Status |\r\n|--------------------|-----------|------|--------|\r\n| iso-8859-1 … iso-8859-10 | ✓ | ✓ | Safe |\r\n| iso-8859-11, ISO8859-11 | ✓ | ✗ | **CRASH** |\r\n| iso-8859-13 … iso-8859-16 | ✓ | ✓ | Safe |\r\n| EUC-JP aliases: UJIS | ✓ | ✗ | **CRASH** |\r\n| EUC-CN aliases: GB-2312 | ✓ | ✗ | **CRASH** |\r\n| KOI8 aliases: KOI-8R | ✓ | ✗ | **CRASH** |\r\n| ASCII aliases: US_ASCII, ISO646 | ✓ | ✗ | **CRASH** |\r\n| KOI8 (no suffix) | ✓ | ✗ | Safe (rejected by mb_regex_encoding()) |\r\n| All other encodings | ✓ | ✓ | Safe |\r\n\r\n### Credits\r\nViet Hoang Luu - The University of Melbourne\r\nAmirmohammad Pasdar - The University of Melbourne\r\nWachiraphan Charoenwet - The University of Melbourne\r\nShaanan Cohney - The University of Melbourne\r\nToby Murray - The University of Melbourne\r\nVan-Thuan Pham - The University of Melbourne\r\n\n\nAffected packages: php:ext-mbstring\nPatched: ext-mbstring 8.5.6, ext-mbstring 8.4.21, ext-mbstring 8.3.31, ext-mbstring 8.2.31","url":"https://github.com/php/php-src/security/advisories/GHSA-wm6j-2649-pv75","published_at":"2026-05-07T12:57:13Z","updated_at":"2026-05-07T12:57:13Z","fetched_at":"2026-11-22T14:05:37.431182Z","severity":"medium","cvss_score":6.5,"epss":0.00186,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"ext-mbstring","vuln_id":"CVE-2026-7259","vuln_ids":["CVE-2025-14179","CVE-2026-12184","CVE-2026-6104","CVE-2026-6722","CVE-2026-6735","CVE-2026-7258","CVE-2026-7259","CVE-2026-7261","CVE-2026-7262","CVE-2026-7263","CVE-2026-7568","GHSA-WM6J-2649-PV75"],"tags":["repo-advisory","php","CWE-476","security","repo:php/php-src","stack"],"cluster_id":11750,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12641","html":"https://vulnwatch.ve1ve2.com/item/12641"}}]}