CVE-2014-0185
NoneCVSS
—
EPSS
0.5%
Published
May 6, 2014
CISA due date
—
Cloudanix analysis
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.
- 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
- Obtain local shell on the affected host
- Locate the FPM UNIX socket file (commonly under /var/run)
- Connect using a crafted FastCGI client or library
- Issue requests that trigger code execution as the FPM pool user
- 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
- CVE-2017-12933 The finish_nested_data function in ext/standard/var_unserializer.re in PHP before 5.6.31… 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-7478 Zend/zend_exceptions.c in PHP, possibly 5.x before 5.6.28 and 7.x before 7.0.13, allows… Also affects php5
- CVE-2016-7418 The php_wddx_push_element function in ext/wddx/wddx.c in PHP before 5.6.26 and 7.x before… Also affects php5
- CVE-2016-7124 ext/standard/var_unserializer.c in PHP before 5.6.25 and 7.x before 7.0.10 mishandles… Also affects php5
- CVE-2016-5771 spl_array.c in the SPL extension in PHP before 5.5.37 and 5.6.x before 5.6.23 improperly… Also affects php5