[openssl/openssl] 8780a8: Fix DH_check() excessive time with over sized modulus

Matt Caswell noreply at github.com
Wed Jul 19 09:27:13 UTC 2023


  Branch: refs/heads/OpenSSL_1_1_1-stable
  Home:   https://github.com/openssl/openssl
  Commit: 8780a896543a654e757db1b9396383f9d8095528
      https://github.com/openssl/openssl/commit/8780a896543a654e757db1b9396383f9d8095528
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-07-19 (Wed, 19 Jul 2023)

  Changed paths:
    M crypto/dh/dh_check.c
    M crypto/dh/dh_err.c
    M crypto/err/openssl.txt
    M include/openssl/dh.h
    M include/openssl/dherr.h

  Log Message:
  -----------
  Fix DH_check() excessive time with over sized modulus

The DH_check() function checks numerous aspects of the key or parameters
that have been supplied. Some of those checks use the supplied modulus
value even if it is excessively large.

There is already a maximum DH modulus size (10,000 bits) over which
OpenSSL will not generate or derive keys. DH_check() will however still
perform various tests for validity on such a large modulus. We introduce a
new maximum (32,768) over which DH_check() will just fail.

An application that calls DH_check() and supplies a key or parameters
obtained from an untrusted source could be vulnerable to a Denial of
Service attack.

The function DH_check() is itself called by a number of other OpenSSL
functions. An application calling any of those other functions may
similarly be affected. The other functions affected by this are
DH_check_ex() and EVP_PKEY_param_check().

CVE-2023-3446

Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove at arm.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21452)


  Commit: e9ddae17e302a7e6a0daf00f25efed7c70f114d4
      https://github.com/openssl/openssl/commit/e9ddae17e302a7e6a0daf00f25efed7c70f114d4
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-07-19 (Wed, 19 Jul 2023)

  Changed paths:
    M test/dhtest.c

  Log Message:
  -----------
  Add a test for CVE-2023-3446

Confirm that the only errors DH_check() finds with DH parameters with an
excessively long modulus is that the modulus is too large. We should not
be performing time consuming checks using that modulus.

Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove at arm.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21452)


  Commit: 97b4f2b515ffd3ce91c6d5cd6d04614a4a15d7df
      https://github.com/openssl/openssl/commit/97b4f2b515ffd3ce91c6d5cd6d04614a4a15d7df
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-07-19 (Wed, 19 Jul 2023)

  Changed paths:
    M CHANGES
    M NEWS

  Log Message:
  -----------
  Update CHANGES/NEWS for CVE-2023-3446

Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove at arm.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21452)


Compare: https://github.com/openssl/openssl/compare/fe824ce0c5d5...97b4f2b515ff


More information about the openssl-commits mailing list