Bug 1547725 (CVE-2015-9253)

Summary: CVE-2015-9253 php: Infinite loop in php-fpm when restarting a child using program execution function
Product: [Other] Security Response Reporter: Laura Pardo <lpardo>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: cadonline, fedora, hhorak, jorton, rcollet, schnederle, webstack-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-27 05:00:38 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: 1547726    
Bug Blocks: 1547732    

Description Laura Pardo 2018-02-21 19:55:42 UTC
An issue was discovered in PHP through 7.2.2. The php-fpm master process restarts a child process in an endless loop when using program execution functions (e.g., passthru, exec, shell_exec, or system) with a non-blocking STDIN stream. This allows a remote attacker to generate a DoS on Shared Hosting Services, performed by this php-fpm master process consuming 100% of the CPU and disk space with a large volume of error logs.


References:
https://bugs.php.net/bug.php?id=70185 [php 5.4]
https://bugs.php.net/bug.php?id=75968 [php 7.2]

Comment 1 Laura Pardo 2018-02-21 19:56:10 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1547726]

Comment 2 Huzaifa S. Sidhpurwala 2018-02-27 04:59:52 UTC
Statement:

The Red Hat Product Security Team does not consider this issue as a security flaw because specially crafted PHP scripts (containing embedded operating system commands) are required to trigger this flaw.

Comment 3 cadonline 2018-02-27 08:23:10 UTC
Correction to "containing embedded operating system commands": no embedded operating system commands are needed, only 2 php scripts are needed to CPU-DOS a shared hosting server without leaving a trace where the high load comes from, making it impossible to detect which hosting customer is to blame for.

copy from PHP Bug #75968:

Script 1:
<?php
stream_set_blocking(STDIN, false);
echo "Blah";
?>

Script 2:
<?php
passthru('/usr/bin/php /path/to/1.php');
?>