Bug 1298839 (CVE-2016-1904)

Summary: CVE-2016-1904 php: heap buffer overflow in escapeshell functions
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abhgupta, dmcphers, fedora, jialiu, jokerman, jorton, kseifried, lmeyer, mmaslano, mmccomas, rcollet, sardella, tiwillia, webstack-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-22 20:21:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1298843    
Bug Blocks: 1298833    

Description Andrej Nemec 2016-01-15 09:07:46 UTC
There exist a heap-based buffer overflow that allows one to write a user
tainted data past an allocated buffer. This vulnerability lies in the
following functions:

escapeshellarg
escapeshellcmd

On a default php installation, the memory limit is set to 128MB and this
vulnerability is not triggerable. The analysis shows that this is
triggerable when memory limit is roughly > 1024mb.

Upstream bug:

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

Original report with reproducer:

http://seclists.org/oss-sec/2016/q1/98

CVE assignment:

http://seclists.org/oss-sec/2016/q1/100

Patch:

https://github.com/php/php-src/commit/2871c70efaaaa0f102557a17c727fd4d5204dd4b

Comment 1 Andrej Nemec 2016-01-15 09:09:00 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1298843]

Comment 2 Remi Collet 2016-01-15 09:20:10 UTC
This patch affects PHP 7, so none of the available PHP version in RHEL or RHSCL is affected.

Comment 3 Tomas Hoger 2016-01-22 20:21:16 UTC
Apparently introduced in:

https://github.com/php/php-src/commit/70ddc853fd4757004ac488e6ee892897bb6f395a

As noted in comment 2, this did not affect any PHP version as shipped in Red Hat Enterprise Linux and Red Hat Software Collections.