PHP < 7.1.33 / 7.2.x < 7.2.24 / 7.3.x < 7.3.11 Remote Code Execution Vulnerability. - Nessus

Critical   Plugin ID: 130276

This page contains detailed information about the PHP < 7.1.33 / 7.2.x < 7.2.24 / 7.3.x < 7.3.11 Remote Code Execution Vulnerability. Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 130276
Name: PHP < 7.1.33 / 7.2.x < 7.2.24 / 7.3.x < 7.3.11 Remote Code Execution Vulnerability.
Filename: php_7_3_11.nasl
Vulnerability Published: 2019-10-24
This Plugin Published: 2019-10-25
Last Modification Time: 2022-04-11
Plugin Version: 1.8
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: php_version.nasl
Required KB Items [?]: installed_sw/PHP, www/PHP

Vulnerability Information


Severity: Critical
Vulnerability Published: 2019-10-24
Patch Published: 2019-10-24
CVE [?]: CVE-2019-11043
CPE [?]: cpe:/a:php:php

Synopsis

An application installed on the remote host is affected by a remote code execution vulnerability.

Description

According to its banner, the version of PHP running on the remote web server is prior to 7.1.33, 7.2.x prior to 7.2.24, or 7.3.x prior to 7.3.11. It is, therefore, affected by a remote code execution vulnerability due to insufficient validation of user input. An unauthenticated, remote attacker can exploit this, by sending a specially crafted request, to cause the execution of arbitrary code by breaking the fastcgi_split_path_info directive.

Solution

Upgrade to PHP version 7.3.11 or later.

Public Exploits


Target Network Port(s): 80
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the PHP < 7.1.33 / 7.2.x < 7.2.24 / 7.3.x < 7.3.11 Remote Code Execution Vulnerability. vulnerability:

  1. Metasploit: exploit/multi/http/php_fpm_rce
    [PHP-FPM Underflow RCE]
  2. Exploit-DB: exploits/php/remote/48182.rb
    [EDB-48182: PHP-FPM - Underflow Remote Code Execution (Metasploit)]
  3. Exploit-DB: exploits/php/webapps/47553.md
    [EDB-47553: PHP-FPM + Nginx - Remote Code Execution]
  4. GitHub: https://github.com/HxDDD/CVE-PoC
    [CVE-2019-11043]
  5. GitHub: https://github.com/LubinLew/WEB-CVE
    [CVE-2019-11043]
  6. GitHub: https://github.com/Mr-xn/Penetration_Testing_POC
    [CVE-2019-11043]
  7. GitHub: https://github.com/SexyBeast233/SecBooks
    [CVE-2019-11043]
  8. GitHub: https://github.com/akamajoris/CVE-2019-11043-Docker
    [CVE-2019-11043]
  9. GitHub: https://github.com/alokaranasinghe/cve-2019-11043
    [CVE-2019-11043]
  10. GitHub: https://github.com/b0o/starred
    [CVE-2019-11043]
  11. GitHub: https://github.com/babebbu/TNI-CWC-GGEZ-Hosting
    [CVE-2019-11043]
  12. GitHub: https://github.com/bollwarm/tech-news
    [CVE-2019-11043]
  13. GitHub: https://github.com/fairyming/CVE-2019-11043
    [CVE-2019-11043]
  14. GitHub: https://github.com/hlong12042/CVE_2019_11043
    [CVE-2019-11043]
  15. GitHub: https://github.com/ianxtianxt/CVE-2019-11043
    [CVE-2019-11043]
  16. GitHub: https://github.com/izj007/wechat
    [CVE-2019-11043]
  17. GitHub: https://github.com/jas9reet/CVE-2019-11043
    [CVE-2019-11043: CVE-2019-11043 LAB]
  18. GitHub: https://github.com/jdecool/stars-feed
    [CVE-2019-11043]
  19. GitHub: https://github.com/jiangsir404/POC-S
    [CVE-2019-11043]
  20. GitHub: https://github.com/jptr218/php_hack
    [CVE-2019-11043]
  21. GitHub: https://github.com/lindemer/CVE-2019-11043
    [CVE-2019-11043: PHP-FPM Remote Command Execution Exploit]
  22. GitHub: https://github.com/linuxserver/docker-nextcloud
    [CVE-2019-11043]
  23. GitHub: https://github.com/lovechinacoco/https-github.com-mai-lang-chai-Middleware-Vulnerability-detection
    [CVE-2019-11043]
  24. GitHub: https://github.com/ltfafei/my_POC
    [CVE-2019-11043]
  25. GitHub: https://github.com/lucianonooijen/stargazed
    [CVE-2019-11043]
  26. GitHub: https://github.com/m0ver/drupal-installation-issues
    [CVE-2019-11043]
  27. GitHub: https://github.com/supercid/awesome-starred
    [CVE-2019-11043]
  28. GitHub: https://github.com/tdtc7/qps
    [CVE-2019-11043]
  29. GitHub: https://github.com/tinker-li/CVE-2019-11043
    [CVE-2019-11043]
  30. GitHub: https://github.com/tjkess/byol
    [CVE-2019-11043]
  31. GitHub: https://github.com/ugur-ercan/exploit-collection
    [CVE-2019-11043]
  32. GitHub: https://github.com/whoadmin/pocs
    [CVE-2019-11043]
  33. GitHub: https://github.com/zhengjim/loophole
    [CVE-2019-11043]
  34. GitHub: https://github.com/offensive-security/exploitdb-bin-sploits/blob/master/bin-sploits/47553.zip
    [EDB-47553]
  35. GitHub: https://github.com/0th3rs-Security-Team/CVE-2019-11043
    [CVE-2019-11043: CVE-2019-11043 PHP7.x RCE]
  36. GitHub: https://github.com/AleWong/PHP-FPM-Remote-Code-Execution-Vulnerability-CVE-2019-11043-
    [CVE-2019-11043: PHP-FPM Remote Code Execution Vulnerability (CVE-2019-11043) POC in Python]
  37. GitHub: https://github.com/B1gd0g/CVE-2019-11043
    [CVE-2019-11043]
  38. GitHub: https://github.com/corifeo/CVE-2019-11043
    [CVE-2019-11043: Quick and dirty PHP RCE proof of concept]
  39. GitHub: https://github.com/huowen/CVE-2019-11043
    [CVE-2019-11043: Python exp for CVE-2019-11043]
  40. GitHub: https://github.com/k8gege/CVE-2019-11043
    [CVE-2019-11043: Ladon POC Moudle CVE-2019-11043 (PHP-FPM + Ngnix)]
  41. GitHub: https://github.com/kriskhub/CVE-2019-11043
    [CVE-2019-11043: This repository provides a dockerized infrastructure and a python implementation of ...]
  42. GitHub: https://github.com/MRdoulestar/CVE-2019-11043
    [CVE-2019-11043: CVE-2019-11043 && PHP7.x && RCE EXP]
  43. GitHub: https://github.com/neex/phuip-fpizdam
    [CVE-2019-11043: Exploit for CVE-2019-11043]
  44. GitHub: https://github.com/shadow-horse/cve-2019-11043
    [CVE-2019-11043: CVE-2019-11043 PHP远程代码执行]
  45. GitHub: https://github.com/theMiddleBlue/CVE-2019-11043
    [CVE-2019-11043: (PoC) Python version of CVE-2019-11043 exploit by neex]
  46. GitHub: https://github.com/ypereirareis/docker-CVE-2019-11043
    [CVE-2019-11043: Docker image and commands to check CVE-2019-11043 vulnerability on nginx/php-fpm ...]
  47. GitHub: https://github.com/jas502n/CVE-2019-11043
    [CVE-2019-11043: Php-fpm+Nginx RCE]
  48. GitHub: https://github.com/moniik/CVE-2019-11043_env
    [CVE-2019-11043: Remote debug environment for CLion]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS Score Source [?]: CVE-2019-11043
CVSS V2 Vector: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:H/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.5 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.5 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:9.8 (Critical)
Impact Subscore:5.9
Exploitability Subscore:3.9
CVSS Temporal Score:9.4 (Critical)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:9.4 (Critical)
STIG Severity [?]: I
STIG Risk Rating: High

Go back to menu.

Plugin Source


This is the php_7_3_11.nasl nessus plugin source code. This script is Copyright (C) 2019-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#

#
# (C) Tenable Network Security, Inc.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(130276);
  script_version("1.8");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2019-11043");
  script_xref(name:"IAVA", value:"2019-A-0399-S");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/04/15");

  script_name(english:"PHP < 7.1.33 / 7.2.x < 7.2.24 / 7.3.x < 7.3.11 Remote Code Execution Vulnerability.");

  script_set_attribute(attribute:"synopsis", value:
"An application installed on the remote host is affected by a remote code execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"According to its banner, the version of PHP running on the remote web server is 
prior to 7.1.33, 7.2.x prior to 7.2.24, or 7.3.x prior to 7.3.11. It is, 
therefore, affected by a remote code execution vulnerability due to insufficient 
validation of user input. An unauthenticated, remote attacker can exploit this, by sending a specially crafted request,
to cause the execution of arbitrary code by breaking the fastcgi_split_path_info directive.");
  script_set_attribute(attribute:"see_also", value:"https://www.php.net/ChangeLog-7.php#7.3.11");
  script_set_attribute(attribute:"see_also", value:"https://www.php.net/ChangeLog-7.php#7.2.24");
  script_set_attribute(attribute:"see_also", value:"https://www.php.net/ChangeLog-7.php#7.1.33");
  script_set_attribute(attribute:"see_also", value:"https://bugs.php.net/bug.php?id=78599");
  script_set_attribute(attribute:"solution", value:
"Upgrade to PHP version 7.3.11 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2019-11043");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'PHP-FPM Underflow RCE');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2019/10/24");
  script_set_attribute(attribute:"patch_publication_date", value:"2019/10/24");
  script_set_attribute(attribute:"plugin_publication_date", value:"2019/10/25");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:php:php");
  script_set_attribute(attribute:"stig_severity", value:"I");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"CGI abuses");

  script_copyright(english:"This script is Copyright (C) 2019-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("php_version.nasl");
  script_require_keys("www/PHP", "installed_sw/PHP");
  script_require_ports("Services/www", 80);

  exit(0);
}

include('http.inc');
include('vcf.inc');
include('audit.inc');

port = get_http_port(default:80, php:TRUE);
app_info = vcf::get_app_info(app:'PHP', port:port, webapp:TRUE);

backported = get_kb_item('www/php/' + port + '/' + app_info.version + '/backported');

if ((report_paranoia < 2) && backported) audit(AUDIT_BACKPORT_SERVICE, port, 'PHP ' + app_info.version + ' install');

constraints = [
    {'min_version':'5.6.0alpha1', 'fixed_version':'7.1.33'},
    {'min_version':'7.2.0alpha1', 'fixed_version':'7.2.24'},
    {'min_version':'7.3.0alpha1', 'fixed_version':'7.3.11'}
    ];
vcf::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_HOLE);

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/php_7_3_11.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\php_7_3_11.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/php_7_3_11.nasl

Go back to menu.

How to Run


Here is how to run the PHP < 7.1.33 / 7.2.x < 7.2.24 / 7.3.x < 7.3.11 Remote Code Execution Vulnerability. as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select CGI abuses plugin family.
  6. On the right side table select PHP < 7.1.33 / 7.2.x < 7.2.24 / 7.3.x < 7.3.11 Remote Code Execution Vulnerability. plugin ID 130276.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl php_7_3_11.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a php_7_3_11.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - php_7_3_11.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state php_7_3_11.nasl -t <IP/HOST>

Go back to menu.

References


IAVA | Information Assurance Vulnerability Alert:
  • 2019-A-0399-S
See also: Similar and related Nessus plugins:
  • 130283 - Debian DLA-1970-1 : php5 security update
  • 130329 - GLSA-201910-01 : PHP: Arbitrary code execution
  • 130349 - Debian DSA-4552-1 : php7.0 - security update
  • 130350 - Debian DSA-4553-1 : php7.3 - security update
  • 130362 - Ubuntu 16.04 LTS / 18.04 LTS / 19.04 / 19.10 : PHP vulnerability (USN-4166-1)
  • 130390 - SUSE SLES12 Security Update : php7 (SUSE-SU-2019:2809-1)
  • 130411 - Fedora 31 : php (2019-4adc49a476)
  • 130421 - SUSE SLED15 / SLES15 Security Update : php7 (SUSE-SU-2019:2819-1)
  • 130442 - Oracle Linux 7 : php (ELSA-2019-3286)
  • 130445 - RHEL 7 : php (RHSA-2019:3286)
  • 130446 - RHEL 6 : php (RHSA-2019:3287)
  • 130447 - Scientific Linux Security Update : php on SL7.x x86_64 (20191031)
  • 130470 - Amazon Linux 2 : php (ALAS-2019-1344)
  • 130471 - Amazon Linux AMI : php71 / php72, php73, php56 (ALAS-2019-1315)
  • 130473 - CentOS 7 : php (CESA-2019:3286)
  • 130474 - CentOS 6 : php (CESA-2019:3287)
  • 130476 - Fedora 29 : php (2019-187ae3128d)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file php_7_3_11.nasl version 1.8. For more plugins, visit the Nessus Plugin Library.

Go back to menu.