OpenSSL 1.0.2 < 1.0.2zd Vulnerability - Nessus
High Plugin ID: 158973This page contains detailed information about the OpenSSL 1.0.2 < 1.0.2zd Vulnerability Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.
Plugin Overview
ID: 158973
Name: OpenSSL 1.0.2 < 1.0.2zd Vulnerability
Filename: openssl_1_0_2zd.nasl
Vulnerability Published: 2022-03-15
This Plugin Published: 2022-03-16
Last Modification Time: 2022-03-23
Plugin Version: 1.4
Plugin Type: remote
Plugin Family: Web Servers
Dependencies:
openssl_version.nasl
Required KB Items [?]: openssl/port
Vulnerability Information
Severity: High
Vulnerability Published: 2022-03-15
Patch Published: 2022-03-15
CVE [?]: CVE-2022-0778
CPE [?]: cpe:/a:openssl:openssl
Synopsis
The remote service is affected by a vulnerability.
Description
The version of OpenSSL installed on the remote host is prior to 1.0.2zd. It is, therefore, affected by a vulnerability as referenced in the 1.0.2zd advisory.
- 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 to OpenSSL version 1.0.2zd or later.
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 OpenSSL 1.0.2 < 1.0.2zd Vulnerability vulnerability:
- GitHub: https://github.com/BobTheShoplifter/CVE-2022-0778-POC
[CVE-2022-0778: Exploring and exploiting CVE-2022-0778.] - 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 ...] - GitHub: https://github.com/jkakavas/CVE-2022-0778-POC
[CVE-2022-0778] - GitHub: https://github.com/yywing/cve-2022-0778
[CVE-2022-0778] - 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-2022-0778
CVSS V2 Vector: AV:N/AC:L/Au:N/C:N/I:N/A:P/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 Base Score: | 7.5 (High) |
Impact Subscore: | 3.6 |
Exploitability Subscore: | 3.9 |
CVSS Temporal Score: | 6.5 (Medium) |
CVSS Environmental Score: | NA (None) |
Modified Impact Subscore: | NA |
Overall CVSS Score: | 6.5 (Medium) |
STIG Risk Rating: High
Go back to menu.
Plugin Source
This is the openssl_1_0_2zd.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.
##
include('deprecated_nasl_level.inc');
include('compat.inc');
if (description)
{
script_id(158973);
script_version("1.4");
script_set_attribute(attribute:"plugin_modification_date", value:"2022/03/23");
script_cve_id("CVE-2022-0778");
script_xref(name:"IAVA", value:"2022-A-0121");
script_name(english:"OpenSSL 1.0.2 < 1.0.2zd Vulnerability");
script_set_attribute(attribute:"synopsis", value:
"The remote service is affected by a vulnerability.");
script_set_attribute(attribute:"description", value:
"The version of OpenSSL installed on the remote host is prior to 1.0.2zd. It is, therefore, affected by a vulnerability
as referenced in the 1.0.2zd advisory.
- 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://cve.org/CVERecord?id=CVE-2022-0778");
# https://github.com/openssl/openssl/commit/380085481c64de749a6dd25cdf0bcf4360b30f83
script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?79cf103a");
script_set_attribute(attribute:"see_also", value:"https://www.openssl.org/news/secadv/20220315.txt");
script_set_attribute(attribute:"solution", value:
"Upgrade to OpenSSL version 1.0.2zd or later.");
script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:P");
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:N/I:N/A:H");
script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
script_set_attribute(attribute:"cvss_score_source", value:"CVE-2022-0778");
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:"2022/03/15");
script_set_attribute(attribute:"patch_publication_date", value:"2022/03/15");
script_set_attribute(attribute:"plugin_publication_date", value:"2022/03/16");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_set_attribute(attribute:"cpe", value:"cpe:/a:openssl:openssl");
script_set_attribute(attribute:"stig_severity", value:"I");
script_end_attributes();
script_category(ACT_GATHER_INFO);
script_family(english:"Web Servers");
script_copyright(english:"This script is Copyright (C) 2022 and is owned by Tenable, Inc. or an Affiliate thereof.");
script_dependencies("openssl_version.nasl");
script_require_keys("openssl/port");
exit(0);
}
include('openssl_version.inc');
openssl_check_version(fixed:'1.0.2zd', min:'1.0.2', severity:SECURITY_WARNING);
The latest version of this script can be found in these locations depending on your platform:
- Linux / Unix:
/opt/nessus/lib/nessus/plugins/openssl_1_0_2zd.nasl
- Windows:
C:\ProgramData\Tenable\Nessus\nessus\plugins\openssl_1_0_2zd.nasl
- Mac OS X:
/Library/Nessus/run/lib/nessus/plugins/openssl_1_0_2zd.nasl
Go back to menu.
How to Run
Here is how to run the OpenSSL 1.0.2 < 1.0.2zd Vulnerability as a standalone plugin via the Nessus web user interface (https://localhost:8834/):
- Click to start a New Scan.
- Select Advanced Scan.
- Navigate to the Plugins tab.
- On the top right corner click to Disable All plugins.
- On the left side table select Web Servers plugin family.
- On the right side table select OpenSSL 1.0.2 < 1.0.2zd Vulnerability plugin ID 158973.
- Specify the target on the Settings tab and click to Save the scan.
- 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 openssl_1_0_2zd.nasl -t <IP/HOST>
Run the plugin with audit trail message on the console:
/opt/nessus/bin/nasl -a openssl_1_0_2zd.nasl -t <IP/HOST>
Run the plugin with trace script execution written to the console (useful for debugging):
/opt/nessus/bin/nasl -T - openssl_1_0_2zd.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 openssl_1_0_2zd.nasl -t <IP/HOST>
Go back to menu.
References
IAVA | Information Assurance Vulnerability Alert:
- 2022-A-0121
- https://www.tenable.com/plugins/nessus/158973
- https://cve.org/CVERecord?id=CVE-2022-0778
- https://www.openssl.org/news/secadv/20220315.txt
- http://www.nessus.org/u?79cf103a
- https://vulners.com/nessus/OPENSSL_1_0_2ZD.NASL
- 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)
- 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
- 159002 - Debian DLA-2952-1 : openssl - 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)
Version
This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file openssl_1_0_2zd.nasl version 1.4. For more plugins, visit the Nessus Plugin Library.
Go back to menu.