Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1340738 - (CVE-2016-5094) CVE-2016-5094 php: Integer overflow in php_html_entities()
CVE-2016-5094 php: Integer overflow in php_html_entities()
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
impact=low,public=20160501,reported=2...
: Security
Depends On: 1340745
Blocks: 1339953
  Show dependency treegraph
 
Reported: 2016-05-30 04:33 EDT by Adam Mariš
Modified: 2016-11-15 09:38 EST (History)
13 users (show)

See Also:
Fixed In Version: php 5.5.36, php 5.6.22
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-07 05:49:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2750 normal SHIPPED_LIVE Moderate: rh-php56 security, bug fix, and enhancement update 2016-11-15 11:40:02 EST

  None (edit)
Description Adam Mariš 2016-05-30 04:33:53 EDT
An integer overflow vulnerability in php_html_entities() was found, allowing to construct string with length outside of integer range.

Upstream bug:

https://bugs.php.net/bug.php?id=72135

Upstream patch:

https://git.php.net/?p=php-src.git;a=commit;h=0da8b8b801f9276359262f1ef8274c7812d3dfda

CVE assignment:

http://seclists.org/oss-sec/2016/q2/412
Comment 1 Adam Mariš 2016-05-30 04:46:59 EDT
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1340745]
Comment 2 Fedora Update System 2016-06-03 11:22:11 EDT
php-5.6.22-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
Comment 3 Tomas Hoger 2016-06-07 05:49:01 EDT
This isn't very practical issue because of the default memory limits set in PHP.  To trigger this, attacker needs to be able to provide sufficiently large input (more than 300MB or 350MB depending on flags used when calling htmlspecialchars() function) that would cause the PHP internal function php_escape_html_entities_ex() to generate output of more than 2GB.  That's not possible in the default configuration of the Red Hat PHP packages, which limits memory a script can use to 128MB.

Additionally, in PHP versions prior to 5.4, length variables (oldlen, newlen) in php_escape_html_entities_ex() are of type int, while they are size_t in 5.4 and newer.  The int variables are casted to size_t when calling emalloc() or erealloc(), leading to attempt to allocate close to SIZE_MAX memory, which fails.  Hence in PHP 5.3 and earlier, php_escape_html_entities_ex() can't return string large enough to trigger this flaw.

In affected versions, this can be mitigated by setting proper memory_limit rather than executing scripts without any limit.
Comment 4 errata-xmlrpc 2016-11-15 06:40:56 EST
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS

Via RHSA-2016:2750 https://rhn.redhat.com/errata/RHSA-2016-2750.html

Note You need to log in before you can comment on or make changes to this bug.