#VU22304 Buffer overflow in PHP


Published: 2020-03-18 | Updated: 2020-11-21

Vulnerability identifier: #VU22304

Vulnerability risk: High

CVSSv3.1: 7.7 [CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C]

CVE-ID: CVE-2019-11043

CWE-ID: CWE-119

Exploitation vector: Network

Exploit availability: Yes

Vulnerable software:
PHP
Universal components / Libraries / Scripting languages

Vendor: PHP Group

Description

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists due to a boundary error in env_path_info in PHP-FPM when processing untrusted input passed via URL. A remote attacker can send a specially crafted HTTP request to the affected server, trigger memory corruption and execute arbitrary code on the target system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system but requires that php-fpm is used with nginx and certain nginx configuration was applied:

  1. The nginx location directive forwards requests to PHP-FPM
  2. The fastcgi_split_path_info directive is present and includes a regular expression beginning with a ‘^’ symbol and ending with a ‘$’ symbol
  3. The fastcgi_param directive is used to assign the PATH_INFO variable
  4. There are no checks in place to determine whether or not a file exists (e.g., using try_files or an if statemen

Mitigation
Install updates from vendor's website.

Vulnerable software versions

PHP: 7.3.0 - 7.3.10, 7.2.0 - 7.2.23, 7.1.0 - 7.1.32


External links
http://bugs.php.net/bug.php?id=78599
http://github.com/neex/phuip-fpizdam
http://www.tenable.com/blog/cve-2019-11043-vulnerability-in-php-fpm-could-lead-to-remote-code-execution-on-nginx
http://github.com/rapid7/metasploit-framework/tree/master/modules/exploits/multi/http/php_fpm_rce.rb


Q & A

Can this vulnerability be exploited remotely?

Yes. This vulnerability can be exploited by a remote non-authenticated attacker via the Internet.

Is there known malware, which exploits this vulnerability?

Yes. This vulnerability is being exploited in the wild.


Latest bulletins with this vulnerability