Debian DLA-1608-1 : php5 security update - Nessus

High   Plugin ID: 119695

This page contains detailed information about the Debian DLA-1608-1 : php5 security update Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 119695
Name: Debian DLA-1608-1 : php5 security update
Filename: debian_DLA-1608.nasl
Vulnerability Published: 2018-11-25
This Plugin Published: 2018-12-17
Last Modification Time: 2021-01-11
Plugin Version: 1.6
Plugin Type: local
Plugin Family: Debian Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/Debian/dpkg-l, Host/Debian/release, Host/local_checks_enabled

Vulnerability Information


Severity: High
Vulnerability Published: 2018-11-25
Patch Published: 2018-12-16
CVE [?]: CVE-2018-19518, CVE-2018-19935
CPE [?]: cpe:/o:debian:debian_linux:8.0, p-cpe:/a:debian:debian_linux:libapache2-mod-php5, p-cpe:/a:debian:debian_linux:libapache2-mod-php5filter, p-cpe:/a:debian:debian_linux:libphp5-embed, p-cpe:/a:debian:debian_linux:php5, p-cpe:/a:debian:debian_linux:php5-cgi, p-cpe:/a:debian:debian_linux:php5-cli, p-cpe:/a:debian:debian_linux:php5-common, p-cpe:/a:debian:debian_linux:php5-curl, p-cpe:/a:debian:debian_linux:php5-dbg, p-cpe:/a:debian:debian_linux:php5-dev, p-cpe:/a:debian:debian_linux:php5-enchant, p-cpe:/a:debian:debian_linux:php5-fpm, p-cpe:/a:debian:debian_linux:php5-gd, p-cpe:/a:debian:debian_linux:php5-gmp, p-cpe:/a:debian:debian_linux:php5-imap, p-cpe:/a:debian:debian_linux:php5-interbase, p-cpe:/a:debian:debian_linux:php5-intl, p-cpe:/a:debian:debian_linux:php5-ldap, p-cpe:/a:debian:debian_linux:php5-mcrypt, p-cpe:/a:debian:debian_linux:php5-mysql, p-cpe:/a:debian:debian_linux:php5-mysqlnd, p-cpe:/a:debian:debian_linux:php5-odbc, p-cpe:/a:debian:debian_linux:php5-pgsql, p-cpe:/a:debian:debian_linux:php5-phpdbg, p-cpe:/a:debian:debian_linux:php5-pspell, p-cpe:/a:debian:debian_linux:php5-readline, p-cpe:/a:debian:debian_linux:php5-recode, p-cpe:/a:debian:debian_linux:php5-snmp, p-cpe:/a:debian:debian_linux:php5-sqlite, p-cpe:/a:debian:debian_linux:php5-sybase, p-cpe:/a:debian:debian_linux:php5-tidy, p-cpe:/a:debian:debian_linux:php5-xmlrpc, p-cpe:/a:debian:debian_linux:php5-xsl, p-cpe:/a:debian:debian_linux:php-pear

Synopsis

The remote Debian host is missing a security update.

Description

Vulnerabilities have been discovered in php5, a server-side, HTML-embedded scripting language. Note that this update includes a change to the default behavior for IMAP connections. See below for details.

CVE-2018-19518

An argument injection vulnerability in imap_open() may allow a remote attacker to execute arbitrary OS commands on the IMAP server.

The fix for the CVE-2018-19518 vulnerability included this additional note from the upstream developers :

Starting with 5.6.38, rsh/ssh logins are disabled by default. Use imap.enable_insecure_rsh if you want to enable them. Note that the IMAP library does not filter mailbox names before passing them to rsh/ssh command, thus passing untrusted data to this function with rsh/ssh enabled is insecure.

CVE-2018-19935

A NULL pointer dereference leads to an application crash and a denial of service via an empty string in the message argument to the imap_mail function of ext/imap/php_imap.c.

For Debian 8 'Jessie', these problems have been fixed in version 5.6.39+dfsg-0+deb8u1.

We recommend that you upgrade your php5 packages.

NOTE: Tenable Network Security has extracted the preceding description block directly from the DLA security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.

Solution

Upgrade the affected packages.

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 Debian DLA-1608-1 : php5 security update vulnerability:

  1. Metasploit: exploit/linux/http/php_imap_open_rce
    [php imap_open Remote Code Execution]
  2. Exploit-DB: exploits/linux/remote/45914.rb
    [EDB-45914: PHP imap_open - Remote Code Execution (Metasploit)]
  3. GitHub: https://github.com/HacTF/poc--exp
    [CVE-2018-19518]
  4. GitHub: https://github.com/SexyBeast233/SecBooks
    [CVE-2018-19518]
  5. GitHub: https://github.com/jiangsir404/POC-S
    [CVE-2018-19518]
  6. GitHub: https://github.com/wateroot/poc-exp
    [CVE-2018-19518]
  7. GitHub: https://github.com/wrlu/Vulnerabilities
    [CVE-2018-19518]
  8. GitHub: https://github.com/ensimag-security/CVE-2018-19518
    [CVE-2018-19518: Some works on CVE-2018-19518]

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 V2 Vector [?]: AV:N/AC:M/Au:S/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:8.5 (High)
Impact Subscore:10.0
Exploitability Subscore:6.8
CVSS Temporal Score:7.0 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.0 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:5.9
Exploitability Subscore:1.6
CVSS Temporal Score:7.0 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.0 (High)

Go back to menu.

Plugin Source


This is the debian_DLA-1608.nasl nessus plugin source code. This script is Copyright (C) 2018-2021 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 Debian Security Advisory DLA-1608-1. The text
# itself is copyright (C) Software in the Public Interest, Inc.
#

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

if (description)
{
  script_id(119695);
  script_version("1.6");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/11");

  script_cve_id("CVE-2018-19518", "CVE-2018-19935");

  script_name(english:"Debian DLA-1608-1 : php5 security update");
  script_summary(english:"Checks dpkg output for the updated packages.");

  script_set_attribute(
    attribute:"synopsis", 
    value:"The remote Debian host is missing a security update."
  );
  script_set_attribute(
    attribute:"description", 
    value:
"Vulnerabilities have been discovered in php5, a server-side,
HTML-embedded scripting language. Note that this update includes a
change to the default behavior for IMAP connections. See below for
details.

CVE-2018-19518

An argument injection vulnerability in imap_open() may allow a remote
attacker to execute arbitrary OS commands on the IMAP server.

The fix for the CVE-2018-19518 vulnerability included this
additional note from the upstream developers :

Starting with 5.6.38, rsh/ssh logins are disabled by
default. Use imap.enable_insecure_rsh if you want to enable
them. Note that the IMAP library does not filter mailbox
names before passing them to rsh/ssh command, thus passing
untrusted data to this function with rsh/ssh enabled is
insecure.

CVE-2018-19935

A NULL pointer dereference leads to an application crash and a denial
of service via an empty string in the message argument to the
imap_mail function of ext/imap/php_imap.c.

For Debian 8 'Jessie', these problems have been fixed in version
5.6.39+dfsg-0+deb8u1.

We recommend that you upgrade your php5 packages.

NOTE: Tenable Network Security has extracted the preceding description
block directly from the DLA security advisory. Tenable has attempted
to automatically clean and format it as much as possible without
introducing additional issues."
  );
  script_set_attribute(
    attribute:"see_also",
    value:"https://lists.debian.org/debian-lts-announce/2018/12/msg00006.html"
  );
  script_set_attribute(
    attribute:"see_also",
    value:"https://packages.debian.org/source/jessie/php5"
  );
  script_set_attribute(attribute:"solution", value:"Upgrade the affected packages.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  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 imap_open Remote Code Execution');
  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:debian:debian_linux:libapache2-mod-php5");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libapache2-mod-php5filter");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libphp5-embed");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php-pear");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-cgi");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-cli");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-common");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-curl");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-dbg");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-dev");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-enchant");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-fpm");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-gd");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-gmp");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-imap");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-interbase");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-intl");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-ldap");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-mcrypt");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-mysql");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-mysqlnd");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-odbc");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-pgsql");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-phpdbg");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-pspell");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-readline");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-recode");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-snmp");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-sqlite");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-sybase");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-tidy");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-xmlrpc");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:php5-xsl");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:8.0");

  script_set_attribute(attribute:"vuln_publication_date", value:"2018/11/25");
  script_set_attribute(attribute:"patch_publication_date", value:"2018/12/16");
  script_set_attribute(attribute:"plugin_publication_date", value:"2018/12/17");
  script_set_attribute(attribute:"generated_plugin", value:"current");
  script_end_attributes();

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

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/Debian/release", "Host/Debian/dpkg-l");

  exit(0);
}


include("audit.inc");
include("debian_package.inc");


if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
if (!get_kb_item("Host/Debian/release")) audit(AUDIT_OS_NOT, "Debian");
if (!get_kb_item("Host/Debian/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING);


flag = 0;
if (deb_check(release:"8.0", prefix:"libapache2-mod-php5", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"libapache2-mod-php5filter", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"libphp5-embed", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php-pear", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-cgi", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-cli", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-common", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-curl", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-dbg", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-dev", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-enchant", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-fpm", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-gd", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-gmp", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-imap", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-interbase", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-intl", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-ldap", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-mcrypt", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-mysql", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-mysqlnd", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-odbc", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-pgsql", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-phpdbg", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-pspell", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-readline", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-recode", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-snmp", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-sqlite", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-sybase", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-tidy", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-xmlrpc", reference:"5.6.39+dfsg-0+deb8u1")) flag++;
if (deb_check(release:"8.0", prefix:"php5-xsl", reference:"5.6.39+dfsg-0+deb8u1")) flag++;

if (flag)
{
  if (report_verbosity > 0) security_hole(port:0, extra:deb_report_get());
  else security_hole(0);
  exit(0);
}
else audit(AUDIT_HOST_NOT, "affected");

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

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

Go back to menu.

How to Run


Here is how to run the Debian DLA-1608-1 : php5 security update 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 Debian Local Security Checks plugin family.
  6. On the right side table select Debian DLA-1608-1 : php5 security update plugin ID 119695.
  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 debian_DLA-1608.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

/opt/nessus/bin/nasl -T - debian_DLA-1608.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 debian_DLA-1608.nasl -t <IP/HOST>

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 121132 - Amazon Linux AMI : php56 / php70,php71,php72 (ALAS-2019-1147)
  • 122548 - Debian DLA-1700-1 : uw-imap security update
  • 156391 - Debian DLA-2866-1 : uw-imap - LTS security update
  • 119561 - Debian DSA-4353-1 : php7.0 - security update
  • 132812 - EulerOS Virtualization for ARM 64 3.0.5.0 : php (EulerOS-SA-2020-1058)
  • 139151 - EulerOS 2.0 SP8 : php (EulerOS-SA-2020-1821)
  • 139998 - EulerOS Virtualization for ARM 64 3.0.6.0 : php (EulerOS-SA-2020-1895)
  • 120566 - Fedora 29 : php (2018-7ebfe1e6f2)
  • 120854 - Fedora 28 : php (2018-dfe1f0bac6)
  • 134965 - GLSA-202003-57 : PHP: Multiple vulnerabilities
  • 119569 - openSUSE Security Update : php5 (openSUSE-2018-1506)
  • 119570 - openSUSE Security Update : php7 (openSUSE-2018-1507)
  • 126034 - openSUSE Security Update : php7 (openSUSE-2019-1572)
  • 126035 - openSUSE Security Update : php7 (openSUSE-2019-1573)
  • 122394 - openSUSE Security Update : php7 (openSUSE-2019-207)
  • 119764 - PHP 5.6.x < 5.6.39 Multiple vulnerabilities
  • 122821 - PHP 7.0.x < 7.0.33 Multiple vulnerabilities
  • 119765 - PHP 7.1.x < 7.1.25 Multiple vulnerabilities
  • 121510 - PHP 7.1.x < 7.1.26 Multiple vulnerabilities.
  • 119766 - PHP 7.2.x < 7.2.13 Multiple vulnerabilities
  • 121353 - PHP 7.2.x < 7.2.14 Multiple vulnerabilities.
  • 111217 - PHP 7.3.0 [alpha
  • 119455 - SUSE SLES11 Security Update : Recommended update for php53 (SUSE-SU-2018:3986-1)
  • 120176 - SUSE SLES12 Security Update : Recommended update for php7 (SUSE-SU-2018:3988-1)
  • 120177 - SUSE SLES12 Security Update : Recommended update for php5 (SUSE-SU-2018:3995-1)
  • 122146 - SUSE SLES12 Security Update : php7 (SUSE-SU-2019:0333-1)
  • 125850 - SUSE SLED15 / SLES15 Security Update : php7 (SUSE-SU-2019:1461-1)
  • 130149 - Ubuntu 16.04 LTS / 18.04 LTS / 19.04 : UW IMAP vulnerability (USN-4160-1)

Version


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

Go back to menu.