Debian DLA-2952-1 : openssl - LTS security update - Nessus

Medium   Plugin ID: 159002

This page contains detailed information about the Debian DLA-2952-1 : openssl - LTS 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: 159002
Name: Debian DLA-2952-1 : openssl - LTS security update
Filename: debian_DLA-2952.nasl
Vulnerability Published: 2019-08-22
This Plugin Published: 2022-03-17
Last Modification Time: 2022-03-21
Plugin Version: 1.3
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: Medium
Vulnerability Published: 2019-08-22
Patch Published: 2022-03-17
CVE [?]: CVE-2019-1551, CVE-2022-0778
CPE [?]: cpe:/o:debian:debian_linux:9.0, p-cpe:/a:debian:debian_linux:libssl1.1, p-cpe:/a:debian:debian_linux:libssl-dev, p-cpe:/a:debian:debian_linux:libssl-doc, p-cpe:/a:debian:debian_linux:openssl

Synopsis

The remote Debian host is missing one or more security-related updates.

Description

The remote Debian 9 host has packages installed that are affected by multiple vulnerabilities as referenced in the dla-2952 advisory.

- There is an overflow bug in the x64_64 Montgomery squaring procedure used in exponentiation with 512-bit moduli. No EC algorithms are affected. Analysis suggests that attacks against 2-prime RSA1024, 3-prime RSA1536, and DSA1024 as a result of this defect would be very difficult to perform and are not believed likely. Attacks against DH512 are considered just feasible. However, for an attack the target would have to re-use the DH512 private key, which is not recommended anyway. Also applications directly using the low level API BN_mod_exp may be affected if they use BN_FLG_CONSTTIME. Fixed in OpenSSL 1.1.1e (Affected 1.1.1-1.1.1d). Fixed in OpenSSL 1.0.2u (Affected 1.0.2-1.0.2t). (CVE-2019-1551)

- The BN_mod_sqrt() function, which computes a modular square root, contains a bug that can cause it to loop forever for non-prime moduli. Internally this function is used when parsing certificates that contain elliptic curve public keys in compressed form or explicit elliptic curve parameters with a base point encoded in compressed form. It is possible to trigger the infinite loop by crafting a certificate that has invalid explicit curve parameters. Since certificate parsing happens prior to verification of the certificate signature, any process that parses an externally supplied certificate may thus be subject to a denial of service attack. The infinite loop can also be reached when parsing crafted private keys as they can contain explicit elliptic curve parameters. Thus vulnerable situations include: - TLS clients consuming server certificates - TLS servers consuming client certificates - Hosting providers taking certificates or private keys from customers - Certificate authorities parsing certification requests from subscribers - Anything else which parses ASN.1 elliptic curve parameters Also any other applications that use the BN_mod_sqrt() where the attacker can control the parameter values are vulnerable to this DoS issue. In the OpenSSL 1.0.2 version the public key is not parsed during initial parsing of the certificate which makes it slightly harder to trigger the infinite loop. However any operation which requires the public key from the certificate will trigger the infinite loop. In particular the attacker can use a self- signed certificate to trigger the loop during verification of the certificate signature. This issue affects OpenSSL versions 1.0.2, 1.1.1 and 3.0. It was addressed in the releases of 1.1.1n and 3.0.2 on the 15th March 2022. Fixed in OpenSSL 3.0.2 (Affected 3.0.0,3.0.1). Fixed in OpenSSL 1.1.1n (Affected 1.1.1-1.1.1m). Fixed in OpenSSL 1.0.2zd (Affected 1.0.2-1.0.2zc). (CVE-2022-0778)

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number.

Solution

Upgrade the openssl packages.

For Debian 9 stretch, these problems have been fixed in version 1.1.0l-1~deb9u5.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (GitHub)
Exploit Ease: Exploits (PoCs) are available

Here's the list of publicly known exploits and PoCs for verifying the Debian DLA-2952-1 : openssl - LTS security update vulnerability:

  1. GitHub: https://github.com/siddharthraopotukuchi/trivy
    [CVE-2019-1551]
  2. GitHub: https://github.com/t31m0/Vulnerability-Scanner-for-Containers
    [CVE-2019-1551]
  3. GitHub: https://github.com/thecyberbaby/Trivy-by-aquaSecurity
    [CVE-2019-1551]
  4. GitHub: https://github.com/umahari/security
    [CVE-2019-1551]
  5. GitHub: https://github.com/vinamra28/tekton-image-scan-trivy
    [CVE-2019-1551]
  6. GitHub: https://github.com/BobTheShoplifter/CVE-2022-0778-POC
    [CVE-2022-0778: Exploring and exploiting CVE-2022-0778.]
  7. GitHub: https://github.com/drago-96/CVE-2022-0778
    [CVE-2022-0778: Proof of concept for CVE-2022-0778, which triggers an infinite loop in parsing X.509 ...]
  8. GitHub: https://github.com/jkakavas/CVE-2022-0778-POC
    [CVE-2022-0778]
  9. GitHub: https://github.com/yywing/cve-2022-0778
    [CVE-2022-0778]
  10. GitHub: https://github.com/0xUhaw/CVE-2022-0778
    [CVE-2022-0778: Proof of concept for CVE-2022-0778 in P12 and PEM format]

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-1551
CVSS V2 Vector: AV:N/AC:L/Au:N/C:P/I:N/A:N/E:U/RL:OF/RC:C
CVSS Base Score:5.0 (Medium)
Impact Subscore:2.9
Exploitability Subscore:10.0
CVSS Temporal Score:3.7 (Low)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:3.7 (Low)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:U/RL:O/RC:C
CVSS Base Score:5.3 (Medium)
Impact Subscore:1.4
Exploitability Subscore:3.9
CVSS Temporal Score:4.6 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:4.6 (Medium)
STIG Severity [?]: I
STIG Risk Rating: High

Go back to menu.

Plugin Source


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

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

if (description)
{
  script_id(159002);
  script_version("1.3");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/03/21");

  script_cve_id("CVE-2019-1551", "CVE-2022-0778");
  script_xref(name:"IAVA", value:"2020-A-0326");
  script_xref(name:"IAVA", value:"2020-A-0321");
  script_xref(name:"IAVA", value:"2019-A-0303-S");
  script_xref(name:"IAVA", value:"2022-A-0121");

  script_name(english:"Debian DLA-2952-1 : openssl - LTS security update");

  script_set_attribute(attribute:"synopsis", value:
"The remote Debian host is missing one or more security-related updates.");
  script_set_attribute(attribute:"description", value:
"The remote Debian 9 host has packages installed that are affected by multiple vulnerabilities as referenced in the
dla-2952 advisory.

  - There is an overflow bug in the x64_64 Montgomery squaring procedure used in exponentiation with 512-bit
    moduli. No EC algorithms are affected. Analysis suggests that attacks against 2-prime RSA1024, 3-prime
    RSA1536, and DSA1024 as a result of this defect would be very difficult to perform and are not believed
    likely. Attacks against DH512 are considered just feasible. However, for an attack the target would have
    to re-use the DH512 private key, which is not recommended anyway. Also applications directly using the low
    level API BN_mod_exp may be affected if they use BN_FLG_CONSTTIME. Fixed in OpenSSL 1.1.1e (Affected
    1.1.1-1.1.1d). Fixed in OpenSSL 1.0.2u (Affected 1.0.2-1.0.2t). (CVE-2019-1551)

  - The BN_mod_sqrt() function, which computes a modular square root, contains a bug that can cause it to loop
    forever for non-prime moduli. Internally this function is used when parsing certificates that contain
    elliptic curve public keys in compressed form or explicit elliptic curve parameters with a base point
    encoded in compressed form. It is possible to trigger the infinite loop by crafting a certificate that has
    invalid explicit curve parameters. Since certificate parsing happens prior to verification of the
    certificate signature, any process that parses an externally supplied certificate may thus be subject to a
    denial of service attack. The infinite loop can also be reached when parsing crafted private keys as they
    can contain explicit elliptic curve parameters. Thus vulnerable situations include: - TLS clients
    consuming server certificates - TLS servers consuming client certificates - Hosting providers taking
    certificates or private keys from customers - Certificate authorities parsing certification requests from
    subscribers - Anything else which parses ASN.1 elliptic curve parameters Also any other applications that
    use the BN_mod_sqrt() where the attacker can control the parameter values are vulnerable to this DoS
    issue. In the OpenSSL 1.0.2 version the public key is not parsed during initial parsing of the certificate
    which makes it slightly harder to trigger the infinite loop. However any operation which requires the
    public key from the certificate will trigger the infinite loop. In particular the attacker can use a self-
    signed certificate to trigger the loop during verification of the certificate signature. This issue
    affects OpenSSL versions 1.0.2, 1.1.1 and 3.0. It was addressed in the releases of 1.1.1n and 3.0.2 on the
    15th March 2022. Fixed in OpenSSL 3.0.2 (Affected 3.0.0,3.0.1). Fixed in OpenSSL 1.1.1n (Affected
    1.1.1-1.1.1m). Fixed in OpenSSL 1.0.2zd (Affected 1.0.2-1.0.2zc). (CVE-2022-0778)

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version
number.");
  script_set_attribute(attribute:"see_also", value:"https://security-tracker.debian.org/tracker/source-package/openssl");
  script_set_attribute(attribute:"see_also", value:"https://www.debian.org/lts/security/2022/dla-2952");
  script_set_attribute(attribute:"see_also", value:"https://security-tracker.debian.org/tracker/CVE-2019-1551");
  script_set_attribute(attribute:"see_also", value:"https://security-tracker.debian.org/tracker/CVE-2022-0778");
  script_set_attribute(attribute:"see_also", value:"https://packages.debian.org/source/stretch/openssl");
  script_set_attribute(attribute:"solution", value:
"Upgrade the openssl packages.

For Debian 9 stretch, these problems have been fixed in version 1.1.0l-1~deb9u5.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
  script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2019-1551");

  script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"false");

  script_set_attribute(attribute:"vuln_publication_date", value:"2019/08/22");
  script_set_attribute(attribute:"patch_publication_date", value:"2022/03/17");
  script_set_attribute(attribute:"plugin_publication_date", value:"2022/03/17");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libssl-dev");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libssl-doc");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libssl1.1");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:openssl");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:9.0");
  script_set_attribute(attribute:"stig_severity", value:"I");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Debian Local Security Checks");

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

  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/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING);

var release = get_kb_item('Host/Debian/release');
if ( isnull(release) ) audit(AUDIT_OS_NOT, 'Debian');
var release = chomp(release);
if (! preg(pattern:"^(9)\.[0-9]+", string:release)) audit(AUDIT_OS_NOT, 'Debian 9.0', 'Debian ' + release);
var cpu = get_kb_item('Host/cpu');
if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
if ('x86_64' >!< cpu && cpu !~ "^i[3-6]86$" && 'aarch64' >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, 'Debian', cpu);

var pkgs = [
    {'release': '9.0', 'prefix': 'libssl-dev', 'reference': '1.1.0l-1~deb9u5'},
    {'release': '9.0', 'prefix': 'libssl-doc', 'reference': '1.1.0l-1~deb9u5'},
    {'release': '9.0', 'prefix': 'libssl1.1', 'reference': '1.1.0l-1~deb9u5'},
    {'release': '9.0', 'prefix': 'openssl', 'reference': '1.1.0l-1~deb9u5'}
];

var flag = 0;
foreach package_array ( pkgs ) {
  var release = NULL;
  var prefix = NULL;
  var reference = NULL;
  if (!empty_or_null(package_array['release'])) release = package_array['release'];
  if (!empty_or_null(package_array['prefix'])) prefix = package_array['prefix'];
  if (!empty_or_null(package_array['reference'])) reference = package_array['reference'];
  if (release && prefix && reference) {
    if (deb_check(release:release, prefix:prefix, reference:reference)) flag++;
  }
}

if (flag)
{
  security_report_v4(
    port       : 0,
    severity   : SECURITY_WARNING,
    extra      : deb_report_get()
  );
  exit(0);
}
else
{
  var tested = deb_pkg_tests_get();
  if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
  else audit(AUDIT_PACKAGE_NOT_INSTALLED, 'libssl-dev / libssl-doc / libssl1.1 / openssl');
}

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-2952.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\debian_DLA-2952.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/debian_DLA-2952.nasl

Go back to menu.

How to Run


Here is how to run the Debian DLA-2952-1 : openssl - LTS 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-2952-1 : openssl - LTS security update plugin ID 159002.
  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-2952.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

Go back to menu.

References


IAVA | Information Assurance Vulnerability Alert:
  • 2019-A-0303-S, 2020-A-0321, 2020-A-0326, 2022-A-0121
See also: Similar and related Nessus plugins:
  • 150139 - Tenable Log Correlation Engine (LCE) < 6.0.9 (TNS-2021-10)
  • 151794 - Amazon Linux 2 : openssl (ALAS-2021-1687)
  • 158937 - Ubuntu 16.04 LTS : OpenSSL vulnerability (USN-5328-2)
  • 158940 - Ubuntu 18.04 LTS / 21.10 : OpenSSL vulnerability (USN-5328-1)
  • 158954 - Amazon Linux 2 : openssl, openssl11 (ALAS-2022-1766)
  • 158958 - SUSE SLES12 Security Update : compat-openssl098 (SUSE-SU-2022:0859-1)
  • 158960 - SUSE SLES15 Security Update : openssl-1_1 (SUSE-SU-2022:0851-1)
  • 158964 - SUSE SLES15 Security Update : openssl-1_0_0 (SUSE-SU-2022:0856-1)
  • 158967 - SUSE SLES12 Security Update : openssl (SUSE-SU-2022:0854-1)
  • 158969 - SUSE SLES15 Security Update : openssl-1_1 (SUSE-SU-2022:0853-1)
  • 158973 - OpenSSL 1.0.2 < 1.0.2zd Vulnerability
  • 158974 - OpenSSL 1.1.1 < 1.1.1n Vulnerability
  • 158975 - OpenSSL 3.0.0 < 3.0.2 Vulnerability
  • 158979 - Debian DSA-5103-1 : openssl - security update
  • 158986 - Amazon Linux AMI : openssl (ALAS-2022-1575)
  • 158990 - FreeBSD : OpenSSL -- Infinite loop in BN_mod_sqrt parsing certificates (ea05c456-a4fd-11ec-90de-1c697aa5a594)
  • 159001 - Debian DLA-2953-1 : openssl1.0 - LTS security update
  • 159013 - SUSE SLES12 Security Update : openssl-1_1 (SUSE-SU-2022:0860-1)
  • 159023 - SUSE SLES11 Security Update : openssl1 (SUSE-SU-2022:14916-1)
  • 159027 - SUSE SLES12 Security Update : openssl-1_0_0 (SUSE-SU-2022:0857-1)
  • 159032 - SUSE SLES11 Security Update : openssl (SUSE-SU-2022:14915-1)
  • 159036 - openSUSE 15 Security Update : openssl-1_0_0 (openSUSE-SU-2022:0856-1)
  • 159055 - Slackware Linux 14.2 / 15.0 / current openssl Vulnerability (SSA:2022-076-02)
  • 159066 - Oracle Linux 7 : openssl (ELSA-2022-9224)
  • 159067 - Oracle Linux 7 : openssl (ELSA-2022-9225)
  • 159071 - Oracle Linux 7 : openssl (ELSA-2022-9237)
  • 159139 - F5 Networks BIG-IP : OpenSSL vulnerability (K31323265)
  • 159173 - Oracle Linux 8 : openssl (ELSA-2022-9233)
  • 159179 - SUSE SLES12 Security Update : nodejs12 (SUSE-SU-2022:0935-1)
  • 159183 - Oracle Linux 8 : openssl (ELSA-2022-9243)
  • 159187 - Oracle Linux 6 : openssl (ELSA-2022-9246)
  • 159274 - RHEL 7 : openssl (RHSA-2022:1077)
  • 159275 - RHEL 7 : openssl (RHSA-2022:1076)
  • 159282 - RHEL 7 : openssl (RHSA-2022:1066)

Version


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

Go back to menu.