CVE-2016-5768
Description
Double free in PHP mbstring's _php_mb_regex_ereg_replace_exec function allows remote code execution or denial of service via crafted input with callback exception.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Double free in PHP mbstring's _php_mb_regex_ereg_replace_exec function allows remote code execution or denial of service via crafted input with callback exception.
Vulnerability
The _php_mb_regex_ereg_replace_exec function in php_mbregex.c within the mbstring extension contains a double free vulnerability. The bug is reachable when a callback exception is triggered during mb_ereg_replace_callback or related operations. Affected versions include PHP before 5.5.37, 5.6.x before 5.6.23, and 7.x before 7.0.8 [1][2][4].
Exploitation
An attacker can exploit this by supplying a crafted regular expression pattern and replacement callback that throws an exception during execution. No special authentication is required for remote exploitation; any network-accessible endpoint using the vulnerable mbstring functions (e.g., mb_ereg_replace_callback) can trigger the flaw. The double free occurs when the internal error handling fails to properly clean up allocated memory after the exception [1].
Impact
Successful exploitation allows remote attackers to execute arbitrary code with the privileges of the PHP process or cause a denial of service (application crash). The vulnerability has a CVSS v3 score of 9.8 (Critical) indicating high impact on confidentiality, integrity, and availability [1].
Mitigation
The vulnerability is fixed in PHP versions 5.5.37, 5.6.23, and 7.0.8 [1][2][4]. Red Hat has released updated packages in RHSA-2016-2750 and RHSA-2016-2598 for Red Hat Enterprise Linux and Software Collections [1][3]. Users should upgrade to the latest patched versions immediately. No workarounds are documented.
AI Insight generated on May 23, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
4- osv-coords2 versionspkg:rpm/suse/php5&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/php5&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP1
< 5.5.14-68.1+ 1 more
- (no CPE)range: < 5.5.14-68.1
- (no CPE)range: < 5.5.14-68.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
14- php.net/ChangeLog-5.phpnvdPatchRelease Notes
- bugs.php.net/bug.phpnvdExploitVendor Advisory
- php.net/ChangeLog-7.phpnvdRelease Notes
- www.openwall.com/lists/oss-security/2016/06/23/4nvdRelease Notes
- github.com/php/php-src/commit/5b597a2e5b28e2d5a52fc1be13f425f08f47cb62nvd
- lists.apple.com/archives/security-announce/2016/Sep/msg00006.htmlnvd
- lists.opensuse.org/opensuse-security-announce/2016-07/msg00004.htmlnvd
- lists.opensuse.org/opensuse-updates/2016-08/msg00003.htmlnvd
- rhn.redhat.com/errata/RHSA-2016-2598.htmlnvd
- rhn.redhat.com/errata/RHSA-2016-2750.htmlnvd
- www.debian.org/security/2016/dsa-3618nvd
- www.securityfocus.com/bid/91396nvd
- h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplaynvd
- support.apple.com/HT207170nvd
News mentions
0No linked articles in our index yet.