Lucene search

K
openvasCopyright (C) 2021 Greenbone AGOPENVAS:1361412562310117839
HistoryDec 16, 2021 - 12:00 a.m.

Diffie-Hellman Ephemeral Key Exchange DoS Vulnerability (SSH, D(HE)ater)

2021-12-1600:00:00
Copyright (C) 2021 Greenbone AG
plugins.openvas.org
2

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

HIGH

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

7.5 High

AI Score

Confidence

High

5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

PARTIAL

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

0.01 Low

EPSS

Percentile

83.9%

The remote SSH server is supporting Diffie-Hellman ephemeral
(DHE) Key Exchange (KEX) algorithms and thus could be prone to a denial of service (DoS)
vulnerability.

# SPDX-FileCopyrightText: 2021 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

if(description)
{
  script_oid("1.3.6.1.4.1.25623.1.0.117839");
  script_version("2023-10-12T05:05:32+0000");
  script_cve_id("CVE-2002-20001", "CVE-2022-40735");
  script_tag(name:"last_modification", value:"2023-10-12 05:05:32 +0000 (Thu, 12 Oct 2023)");
  script_tag(name:"creation_date", value:"2021-12-16 10:47:19 +0000 (Thu, 16 Dec 2021)");
  script_tag(name:"cvss_base", value:"5.0");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:P");
  script_tag(name:"severity_vector", value:"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H");
  script_tag(name:"severity_origin", value:"NVD");
  script_tag(name:"severity_date", value:"2021-11-16 15:36:00 +0000 (Tue, 16 Nov 2021)");
  script_name("Diffie-Hellman Ephemeral Key Exchange DoS Vulnerability (SSH, D(HE)ater)");
  script_copyright("Copyright (C) 2021 Greenbone AG");
  script_category(ACT_GATHER_INFO);
  script_family("SSL and TLS");
  script_dependencies("gb_ssh_algos.nasl");
  script_require_ports("Services/ssh", 22);
  script_mandatory_keys("ssh/algos_available");

  script_xref(name:"URL", value:"https://www.researchgate.net/profile/Anton-Stiglic-2/publication/2401745_Security_Issues_in_the_Diffie-Hellman_Key_Agreement_Protocol");
  script_xref(name:"URL", value:"https://github.com/Balasys/dheater");

  script_tag(name:"summary", value:"The remote SSH server is supporting Diffie-Hellman ephemeral
  (DHE) Key Exchange (KEX) algorithms and thus could be prone to a denial of service (DoS)
  vulnerability.");

  script_tag(name:"vuldetect", value:"Checks the supported KEX algorithms of the remote SSH
  server.");

  script_tag(name:"insight", value:"- CVE-2002-20001: The Diffie-Hellman Key Agreement Protocol
  allows remote attackers (from the client side) to send arbitrary numbers that are actually not
  public keys, and trigger expensive server-side DHE modular-exponentiation calculations, aka a
  D(HE)ater attack. The client needs very little CPU resources and network bandwidth. The attack may
  be more disruptive in cases where a client can require a server to select its largest supported
  key size. The basic attack scenario is that the client must claim that it can only communicate
  with DHE, and the server must be configured to allow DHE.

  - CVE-2022-40735: The Diffie-Hellman Key Agreement Protocol allows use of long exponents that
  arguably make certain calculations unnecessarily expensive, because the 1996 van Oorschot and
  Wiener paper found that '(appropriately) short exponents' can be used when there are adequate
  subgroup constraints, and these short exponents can lead to less expensive calculations than for
  long exponents. This issue is different from CVE-2002-20001 because it is based on an observation
  about exponent size, rather than an observation about numbers that are not public keys. The
  specific situations in which calculation expense would constitute a server-side vulnerability
  depend on the protocol (e.g., TLS, SSH, or IKE) and the DHE implementation details. In general,
  there might be an availability concern because of server-side resource consumption from DHE
  modular-exponentiation calculations. Finally, it is possible for an attacker to exploit this
  vulnerability and CVE-2002-20001 together.");

  script_tag(name:"impact", value:"This vulnerability allows remote attackers (from the client side)
  to send arbitrary numbers that are actually not public keys, and trigger expensive server-side DHE
  modular-exponentiation calculations, also known as a D(HE)ater attack.

  There could be an increase in CPU usage in the affected component. For OpenSSH, users may observe
  issues such as a slowdown in SSH connections.");

  script_tag(name:"solution", value:"- DHE key exchange should be disabled if no other mitigation
  mechanism can be used and either elliptic-curve variant of Diffie-Hellman (ECDHE) or RSA key
  exchange is supported by the clients. The fact that RSA key exchange is not forward secret should
  be considered.

  - Limit the maximum number of concurrent connections in e.g. the configuration of the remote
  server. For OpenSSH this limit can be configured via the 'MaxStartups' option, for other products
  please refer to the manual of the product in question on configuration possibilities.");

  script_tag(name:"qod_type", value:"remote_banner_unreliable");
  script_tag(name:"solution_type", value:"Mitigation");

  exit(0);
}

include("ssh_func.inc");
include("list_array_func.inc");
include("port_service_func.inc");
include("misc_func.inc");

port = ssh_get_port( default:22 );

if( ! supported_kex_algos = get_kb_list( "ssh/" + port + "/kex_algorithms" ) )
  exit( 0 );

# Sort to not report changes on delta reports if just the order is different
supported_kex_algos = sort( supported_kex_algos );

dhe_kex_algos = make_list(
  "diffie-hellman-group1-sha1",
  "diffie-hellman-group1-sha256",
  "diffie-hellman-group14-sha1",
  "diffie-hellman-group14-sha256",
  "diffie-hellman-group15-sha256",
  "diffie-hellman-group15-sha512",
  "diffie-hellman-group16-sha256",
  "diffie-hellman-group16-sha512",
  "diffie-hellman-group17-sha512",
  "diffie-hellman-group18-sha512",
  "diffie-hellman-group-exchange-sha1",
  "diffie-hellman-group-exchange-sha256",
  "diffie-hellman-group-exchange-sha512" );

report = 'The remote SSH server supports the following DHE KEX algorithm(s):\n';

foreach dhe_kex_algo( dhe_kex_algos ) {
  if( in_array( search:dhe_kex_algo, array:supported_kex_algos, part_match:FALSE ) ) {
    report += '\n' + dhe_kex_algo;
    found = TRUE;
  }
}

if( found ) {
  security_message( port:port, data:report );
  exit( 0 );
}

exit( 99 );

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

HIGH

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

7.5 High

AI Score

Confidence

High

5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

PARTIAL

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

0.01 Low

EPSS

Percentile

83.9%