Cloudanix VulnDB

CVE-2014-0185

None

CVSS

—

EPSS

0.5%

Published

May 6, 2014

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A web-server component on the machine used overly open file permissions that let other programs running on the same computer take control of it.

Exploit Available
Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Low
Impact
Privilege Gain
Component
Application
Class
Privilege Escalation
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

PHP FPM creates its UNIX domain socket with 0666 permissions, allowing any local process to connect and issue FastCGI requests that execute with the privileges of the FPM worker pool.

Why it matters to the business

Attackers who already have a shell on the server can obtain root or web-server privileges, leading to full system compromise and data exposure; the issue is more than a decade old with public exploits available.

How an attack unfolds

An attacker with local shell access locates the FPM UNIX socket, crafts a malicious FastCGI client that connects to it, and sends requests that cause the FPM worker to execute attacker-supplied code at elevated privileges.

How to fix it

Upgrade PHP to 5.4.28 or newer, or 5.5.12 or newer; alternatively set the FPM listen.acl_users or listen.mode directives to restrict socket access to the web server user only.

How to confirm the fix worked

Verify PHP version is at least 5.4.28 or 5.5.12; confirm socket permissions are no longer 0666 with ls -l and that listen.acl_users or equivalent restrictions are configured.

Typical attack path

  1. Obtain local shell on the affected host
  2. Locate the FPM UNIX socket file (commonly under /var/run)
  3. Connect using a crafted FastCGI client or library
  4. Issue requests that trigger code execution as the FPM pool user
  5. Escalate to full system control

How to detect it

Review system and web-server logs for unexpected local connections to FPM sockets; look for processes spawning under the FPM worker UID shortly after socket access by non-web users.

What your security team should do

  • Immediately upgrade all PHP installations to a supported branch containing the fix
  • Audit FPM pool configurations and enforce least-privilege socket permissions
  • Remove or disable FPM sockets that are no longer required
  • Monitor for local privilege-escalation attempts on hosts still running legacy PHP

The record

sapi/fpm/fpm/fpm_unix.c in the FastCGI Process Manager (FPM) in PHP before 5.4.28 and 5.5.x before 5.5.12 uses 0666 permissions for the UNIX socket, which allows local users to gain privileges via a crafted FastCGI client.

Affected packages

Ecosystem Package Introduced Fixed
Debian:7 php5 0 5.4.4-14+deb7u10
Mageia:3 php 0 5.4.28-1.mga3
Mageia:3 php-apc 0 3.1.14-7.8.mga3
Mageia:3 php-gd-bundled 0 5.4.28-1.mga3
Mageia:3 php-suhosin 0 0.9.35-1.mga3
Mageia:3 php-timezonedb 0 2014.3-1.mga3
Mageia:4 php 0 5.5.12-1.mga4
Mageia:4 php-apc 0 3.1.15-4.3.mga4
Mageia:4 php-suhosin 0 0.9.35-1.mga4
Mageia:4 php-timezonedb 0 2014.3-1.mga4
Ubuntu:14.04:LTS php5 0 5.5.9+dfsg-1ubuntu4.1
openSUSE:Tumbleweed froxlor 0 0.9.38.4-1.1
openSUSE:Tumbleweed php5 0 5.6.28-1.1
openSUSE:Tumbleweed php7 0 7.0.14-1.4
openSUSE:Tumbleweed php8 0 8.0.11-1.1

Related vulnerabilities