GLSA-201910-01 : PHP: Arbitrary code execution - Nessus

Critical   Plugin ID: 130329

This page contains detailed information about the GLSA-201910-01 : PHP: Arbitrary code execution Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 130329
Name: GLSA-201910-01 : PHP: Arbitrary code execution
Filename: gentoo_GLSA-201910-01.nasl
Vulnerability Published: 2019-10-28
This Plugin Published: 2019-10-28
Last Modification Time: 2022-03-29
Plugin Version: 1.11
Plugin Type: local
Plugin Family: Gentoo Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/Gentoo/qpkg-list, Host/Gentoo/release, Host/local_checks_enabled

Vulnerability Information


Severity: Critical
Vulnerability Published: 2019-10-28
Patch Published: 2019-10-25
CVE [?]: CVE-2019-11043
CPE [?]: cpe:/o:gentoo:linux, p-cpe:/a:gentoo:linux:php

Synopsis

The remote Gentoo host is missing one or more security-related patches.

Description

The remote host is affected by the vulnerability described in GLSA-201910-01 (PHP: Arbitrary code execution)

A underflow in env_path_info in PHP-FPM under certain configurations can be exploited to gain remote code execution. Impact :

A remote attacker, by sending special crafted HTTP requests, could possibly execute arbitrary code with the privileges of the process, or cause a Denial of Service condition. Workaround :

If patching is not feasible, the suggested workaround is to include checks to verify whether or not a file exists before passing to PHP.

Solution

All PHP 5.6 users should upgrade to the latest version: # emerge --sync # emerge --ask --oneshot --verbose '>=dev-lang/php-5.6.40-r7' All PHP 7.1 users should upgrade to the latest version: # emerge --sync # emerge --ask --oneshot --verbose '>=dev-lang/php-7.1.33' All PHP 7.2 users should upgrade to the latest version: # emerge --sync # emerge --ask --oneshot --verbose '>=dev-lang/php-7.2.24' All PHP 7.3 users should upgrade to the latest version: # emerge --sync # emerge --ask --oneshot --verbose '>=dev-lang/php-7.3.11'

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
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 GLSA-201910-01 : PHP: Arbitrary code execution 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 gentoo_GLSA-201910-01.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.
#
# The descriptive text and package checks in this plugin were
# extracted from Gentoo Linux Security Advisory GLSA 201910-01.
#
# The advisory text is Copyright (C) 2001-2022 Gentoo Foundation, Inc.
# and licensed under the Creative Commons - Attribution / Share Alike 
# license. See http://creativecommons.org/licenses/by-sa/3.0/
#

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

if (description)
{
  script_id(130329);
  script_version("1.11");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/03/29");

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

  script_name(english:"GLSA-201910-01 : PHP: Arbitrary code execution");
  script_summary(english:"Checks for updated package(s) in /var/db/pkg");

  script_set_attribute(
    attribute:"synopsis",
    value:
"The remote Gentoo host is missing one or more security-related
patches."
  );
  script_set_attribute(
    attribute:"description",
    value:
"The remote host is affected by the vulnerability described in GLSA-201910-01
(PHP: Arbitrary code execution)

    A underflow in env_path_info in PHP-FPM under certain configurations can
      be exploited to gain remote code execution.
  
Impact :

    A remote attacker, by sending special crafted HTTP requests, could
      possibly execute arbitrary code with the privileges of the process, or
      cause a Denial of Service condition.
  
Workaround :

    If patching is not feasible, the suggested workaround is to include
      checks to verify whether or not a file exists before passing to PHP."
  );
  script_set_attribute(
    attribute:"see_also",
    value:"https://security.gentoo.org/glsa/201910-01"
  );
  script_set_attribute(
    attribute:"solution",
    value:
"All PHP 5.6 users should upgrade to the latest version:
      # emerge --sync
      # emerge --ask --oneshot --verbose '>=dev-lang/php-5.6.40-r7'
    All PHP 7.1 users should upgrade to the latest version:
      # emerge --sync
      # emerge --ask --oneshot --verbose '>=dev-lang/php-7.1.33'
    All PHP 7.2 users should upgrade to the latest version:
      # emerge --sync
      # emerge --ask --oneshot --verbose '>=dev-lang/php-7.2.24'
    All PHP 7.3 users should upgrade to the latest version:
      # emerge --sync
      # emerge --ask --oneshot --verbose '>=dev-lang/php-7.3.11'"
  );
  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:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:gentoo:linux:php");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:gentoo:linux");

  script_set_attribute(attribute:"vuln_publication_date", value:"2019/10/28");
  script_set_attribute(attribute:"patch_publication_date", value:"2019/10/25");
  script_set_attribute(attribute:"plugin_publication_date", value:"2019/10/28");
  script_set_attribute(attribute:"generated_plugin", value:"current");
  script_set_attribute(attribute:"stig_severity", value:"I");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_copyright(english:"This script is Copyright (C) 2019-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");
  script_family(english:"Gentoo Local Security Checks");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/Gentoo/release", "Host/Gentoo/qpkg-list");

  exit(0);
}


include("audit.inc");
include("global_settings.inc");
include("qpkg.inc");

if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
if (!get_kb_item("Host/Gentoo/release")) audit(AUDIT_OS_NOT, "Gentoo");
if (!get_kb_item("Host/Gentoo/qpkg-list")) audit(AUDIT_PACKAGE_LIST_MISSING);


flag = 0;

if (qpkg_check(package:"dev-lang/php", unaffected:make_list("ge 7.1.33", "ge 7.2.24", "ge 7.3.11", "ge 5.6.40-r7"), vulnerable:make_list("lt 7.1.33", "lt 7.2.24", "lt 7.3.11", "lt 5.6.40-r7"))) flag++;

if (flag)
{
  if (report_verbosity > 0) security_hole(port:0, extra:qpkg_report_get());
  else security_hole(0);
  exit(0);
}
else
{
  tested = qpkg_tests_get();
  if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
  else audit(AUDIT_PACKAGE_NOT_INSTALLED, "PHP");
}

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

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

Go back to menu.

How to Run


Here is how to run the GLSA-201910-01 : PHP: Arbitrary code execution 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 Gentoo Local Security Checks plugin family.
  6. On the right side table select GLSA-201910-01 : PHP: Arbitrary code execution plugin ID 130329.
  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 gentoo_GLSA-201910-01.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a gentoo_GLSA-201910-01.nasl -t <IP/HOST>

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

/opt/nessus/bin/nasl -T - gentoo_GLSA-201910-01.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 gentoo_GLSA-201910-01.nasl -t <IP/HOST>

Go back to menu.

References


IAVA | Information Assurance Vulnerability Alert:
  • 2019-A-0399-S
GLSA | Gentoo Linux Security Advisory: See also: Similar and related Nessus plugins:
  • 130276 - PHP < 7.1.33 / 7.2.x < 7.2.24 / 7.3.x < 7.3.11 Remote Code Execution Vulnerability.
  • 130283 - Debian DLA-1970-1 : php5 security update
  • 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)
  • 130482 - Fedora 30 : php (2019-7bb07c3b02)
  • 130497 - Oracle Linux 6 : php (ELSA-2019-3287)

Version


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

Go back to menu.