Cloudanix VulnDB

CVE-2015-9253

Medium · 6.5

CVSS

6.5

EPSS

4.2%

Published

Feb 19, 2018

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

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.

Exploit Available
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

  1. Locate a PHP application hosted under php-fpm that accepts attacker-controlled input to execution functions
  2. Craft HTTP requests or other input that triggers passthru/exec/shell_exec/system with a non-blocking STDIN descriptor
  3. 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