Lucene search

K
openvasCopyright (C) 2019 Greenbone AGOPENVAS:1361412562310108692
HistoryOct 25, 2019 - 12:00 a.m.

PHP 'CVE-2019-11043' FPM Remote Code Execution Vulnerability (Version Check)

2019-10-2500:00:00
Copyright (C) 2019 Greenbone AG
plugins.openvas.org
75

7.5 High

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

10 High

AI Score

Confidence

High

0.975 High

EPSS

Percentile

100.0%

PHP is prone to a remote code execution (RCE) vulnerability in
certain nginx + php-fpm configurations.

# SPDX-FileCopyrightText: 2019 Greenbone AG
# Some text descriptions might be excerpted from (a) referenced
# source(s), and are Copyright (C) by the respective right holder(s).
#
# SPDX-License-Identifier: GPL-2.0-only

CPE = "cpe:/a:php:php";

if(description)
{
  script_oid("1.3.6.1.4.1.25623.1.0.108692");
  script_version("2024-06-28T15:38:46+0000");
  script_tag(name:"last_modification", value:"2024-06-28 15:38:46 +0000 (Fri, 28 Jun 2024)");
  script_tag(name:"creation_date", value:"2019-10-25 11:55:00 +0000 (Fri, 25 Oct 2019)");
  script_tag(name:"cvss_base", value:"7.5");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_tag(name:"severity_vector", value:"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
  script_tag(name:"severity_origin", value:"NVD");
  script_tag(name:"severity_date", value:"2020-08-18 15:05:00 +0000 (Tue, 18 Aug 2020)");
  script_xref(name:"CISA", value:"Known Exploited Vulnerability (KEV) catalog");
  script_xref(name:"URL", value:"https://www.cisa.gov/known-exploited-vulnerabilities-catalog");
  script_cve_id("CVE-2019-11043");
  script_name("PHP 'CVE-2019-11043' FPM Remote Code Execution Vulnerability (Version Check)");
  script_category(ACT_GATHER_INFO);
  script_copyright("Copyright (C) 2019 Greenbone AG");
  script_family("Web application abuses");
  script_dependencies("secpod_php_smb_login_detect.nasl", "gb_php_ssh_login_detect.nasl", "gb_php_http_detect.nasl");
  script_mandatory_keys("php/detected");

  script_xref(name:"URL", value:"https://bugs.php.net/bug.php?id=78599");
  script_xref(name:"URL", value:"https://www.php.net/ChangeLog-7.php#7.3.11");
  script_xref(name:"URL", value:"https://www.php.net/ChangeLog-7.php#7.2.24");
  script_xref(name:"URL", value:"https://www.php.net/ChangeLog-7.php#7.1.33");
  script_xref(name:"URL", value:"https://github.com/neex/phuip-fpizdam");

  script_tag(name:"summary", value:"PHP is prone to a remote code execution (RCE) vulnerability in
  certain nginx + php-fpm configurations.");

  script_tag(name:"vuldetect", value:"Checks if a vulnerable version is present on the target host.");

  script_tag(name:"impact", value:"Successful exploitation would allow an unauthenticated remote attacker to
  execute arbitrary code on the target machine.");

  script_tag(name:"insight", value:"The file sapi/fpm/fpm/fpm_main.c contains pointer arithmetic that assumes
  that env_path_info has a prefix equal to the path to the php script. However, the code does not check this
  assumption is satisfied. The absence of the check can lead to an invalid pointer in the 'path_info' variable.

  Such conditions can be achieved in a pretty standard Nginx configuration. The regexp in `fastcgi_split_path_info`
  directive can be broken using the newline character (in encoded form, %0a). Broken regexp leads to empty PATH_INFO,
  which triggers the bug.");

  script_tag(name:"affected", value:"PHP versions before 7.1.33, 7.2.x before 7.2.24 and 7.3.x before 7.3.11.");

  script_tag(name:"solution", value:"Update to version 7.1.33, 7.2.24, 7.3.11 or later. As an alternative a workaround
  to update the nginx configuration to mitigate this vulnerability is described at the PHP.net bugtracker linked in the
  references.");

  script_tag(name:"qod_type", value:"remote_banner_unreliable"); # Only hosts running PHP via php-fpm AND nginx with a special config are affected
  script_tag(name:"solution_type", value:"VendorFix");

  exit(0);
}

include("host_details.inc");
include("version_func.inc");

if (isnull(port = get_app_port(cpe: CPE)))
  exit(0);

if (!infos = get_app_version_and_location(cpe: CPE, port: port, exit_no_version: TRUE))
  exit(0);

version = infos["version"];
path = infos["location"];

if (version_is_less(version: version, test_version: "7.1.33")) {
  report = report_fixed_ver(installed_version: version, fixed_version: "7.1.33", install_path: path);
  security_message(port: port, data: report);
  exit(0);
}

else if (version_in_range(version: version, test_version: "7.2", test_version2: "7.2.23")) {
  report = report_fixed_ver(installed_version: version, fixed_version: "7.2.24", install_path: path);
  security_message(port: port, data: report);
  exit(0);
}

else if (version_in_range(version: version, test_version: "7.3", test_version2: "7.3.10")) {
  report = report_fixed_ver(installed_version: version, fixed_version: "7.3.11", install_path: path);
  security_message(port: port, data: report);
  exit(0);
}

exit(99);

7.5 High

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

10 High

AI Score

Confidence

High

0.975 High

EPSS

Percentile

100.0%