CVE-2015-9253
Medium · 6.5CVSS
6.5
EPSS
4.2%
Published
Feb 19, 2018
CISA due date
—
Cloudanix analysis
A flaw in PHP's web-server process manager lets attackers make the server run at full speed while filling up its storage, knocking websites offline until fixed.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Application
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The php-fpm master process enters an endless restart loop for child processes when execution functions (passthru, exec, shell_exec, system) are invoked with non-blocking STDIN, driving CPU to 100% and generating large volumes of error logs that consume disk space.
Why it matters to the business
Web services and shared-hosting environments experience sustained outages or severe slowdowns, increased operational costs for log cleanup, and potential loss of availability for customer sites until the affected PHP processes are restarted or the host is rebooted.
How an attack unfolds
An attacker with the ability to supply input that reaches program-execution functions in a PHP script running under php-fpm sends requests that force a non-blocking STDIN stream; the master process then loops indefinitely restarting the child, exhausting CPU and log storage.
How to fix it
Upgrade to PHP 7.1.20 or newer, 7.2.8 or newer, or 7.3.0alpha3 or newer. Where immediate upgrade is impossible, disable non-blocking STDIN usage in execution functions via application changes or apply OS-level CPU and log-size limits to the php-fpm master process.
How to confirm the fix worked
Verify the installed PHP version is at or above the fixed releases listed above; attempt to reproduce the non-blocking STDIN condition in a test environment and confirm the master process no longer loops.
Typical attack path
- Locate a PHP application hosted under php-fpm that accepts attacker-controlled input to execution functions
- Craft HTTP requests or other input that triggers passthru/exec/shell_exec/system with a non-blocking STDIN descriptor
- Observe the php-fpm master process enter the restart loop, pegging CPU at 100% and rapidly writing error logs
How to detect it
Monitor php-fpm master process CPU and memory metrics; inspect php-fpm error logs for repeated child-process restart messages correlated with execution-function calls; correlate with web-server access logs showing requests that reach passthru/exec/shell_exec/system.
- php-fpm master process CPU at or near 100%
- repeated "child process.*restarting" messages in php-fpm error log
- large volumes of php-fpm error logs written in short time windows
- process name: php-fpm master
What your security team should do
- Prioritize upgrade of all php-fpm instances to a fixed PHP release
- Add monitoring alerts for php-fpm master CPU usage above 80% sustained and rapid growth of php-fpm error logs
- Review application code for direct or indirect calls to execution functions with untrusted input
- Apply resource limits (CPU, log rotation) to php-fpm as a defense-in-depth measure
The record
An issue was discovered in PHP 7.3.x before 7.3.0alpha3, 7.2.x before 7.2.8, and before 7.1.20. 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, causing this master process to consume 100% of the CPU, and consume disk space with a large volume of error logs, as demonstrated by an attack by a customer of a shared-hosting facility.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| SUSE:Enterprise Storage 6 | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Enterprise Storage 6 | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise High Performance Computing 15-ESPOS | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise High Performance Computing 15-ESPOS | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise High Performance Computing 15-LTSS | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise High Performance Computing 15-LTSS | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise Module for Web and Scripting 12 | php72 | 0 | 7.2.5-1.75.1 |
| SUSE:Linux Enterprise Server 15 SP1-BCL | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise Server 15 SP1-BCL | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise Server 15-LTSS | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise Server 15-LTSS | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise Server for SAP Applications 15 | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | php7 | 0 | 7.2.5-4.89.4 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | php7 | 0 | 7.2.34-150000.4.103.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP5 | php72 | 0 | 7.2.5-1.75.1 |
| Ubuntu:14.04:LTS | php5 | 0 | 5.5.9+dfsg-1ubuntu4.29+esm10 |
| Ubuntu:14.04:LTS | php5 | 0 | 5.5.9+dfsg-1ubuntu4.26 |
| Ubuntu:16.04:LTS | php7.0 | 0 | 7.0.33-0ubuntu0.16.04.11 |
| Ubuntu:16.04:LTS | php7.0 | 0 | 7.0.32-0ubuntu0.16.04.1 |
| Ubuntu:18.04:LTS | php7.2 | 0 | 7.2.10-0ubuntu0.18.04.1 |
| Ubuntu:18.04:LTS | php7.2 | 0 | 7.2.24-0ubuntu0.18.04.3 |
| Ubuntu:Pro:14.04:LTS | php5 | 0 | 5.5.9+dfsg-1ubuntu4.29+esm10 |
| Ubuntu:Pro:16.04:LTS | php7.0 | 0 | 7.0.33-0ubuntu0.16.04.16+esm3 |
| openSUSE:Leap 15.4 | php7 | 0 | 7.2.34-150000.4.103.1 |
Related vulnerabilities
- CVE-2017-8923 The zend_string_extend function in Zend/zend_string.h in PHP through 7.1.5 does not… Also affects php7
- CVE-2017-16642 In PHP before 5.6.32, 7.x before 7.0.25, and 7.1.x before 7.1.11, an error in the date… Also affects php5
- CVE-2017-12933 The finish_nested_data function in ext/standard/var_unserializer.re in PHP before 5.6.31… Also affects php5
- CVE-2015-8994 An issue was discovered in PHP 5.x and 7.x, when the configuration uses… Also affects php5
- CVE-2016-10158 The exif_convert_any_to_int function in ext/exif/exif.c in PHP before 5.6.30, 7.0.x… Also affects php5
- CVE-2016-10161 The object_common1 function in ext/standard/var_unserializer.c in PHP before 5.6.30… Also affects php5
- CVE-2016-7479 In all versions of PHP 7, during the unserialization process, resizing the 'properties'… Also affects php5
- CVE-2016-7480 The SplObjectStorage unserialize implementation in ext/spl/spl_observer.c in PHP before… Also affects php5