Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 801376

Summary: <net-libs/mbedtls-{2.16.11,2.27.0}: multiple vulnerabilities
Product: Gentoo Security Reporter: John Helmert III <ajak>
Component: VulnerabilitiesAssignee: Gentoo Security <security>
Status: IN_PROGRESS ---    
Severity: minor CC: blueness, jsmolic, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/22637
Whiteboard: B4 [glsa?]
Package list:
net-libs/mbedtls-2.16.11 net-libs/mbedtls-2.27.0-r1
Runtime testing required: ---

Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-07-09 19:11:35 UTC
Two high severity advisories:

https://tls.mbed.org/tech-updates/security-advisories/mbedtls-security-advisory-2021-07-1
https://tls.mbed.org/tech-updates/security-advisories/mbedtls-security-advisory-2021-07-2

And these in 2.27.0 changelog:

Fix a bias in the generation of finite-field Diffie-Hellman-Merkle (DHM)
private keys and of blinding values for DHM and elliptic curves (ECP)
computations. Reported by FlorianF89 in #4245.

Fix a potential side channel vulnerability in ECDSA ephemeral key generation.
An adversary who is capable of very precise timing measurements could
learn partial information about the leading bits of the nonce used for the
signature, allowing the recovery of the private key after observing a
large number of signature operations. This completes a partial fix in
Mbed TLS 2.20.0. 

2.16.11 has these:

It was possible to configure MBEDTLS_ECP_MAX_BITS to a value that is
too small, leading to buffer overflows in ECC operations. Fail the build
in such a case.

An adversary with access to precise enough information about memory
accesses (typically, an untrusted operating system attacking a secure
enclave) could recover an RSA private key after observing the victim
performing a single private-key operation. Found and reported by
Zili KOU, Wenjian HE, Sharad Sinha, and Wei ZHANG.

An adversary with access to precise enough timing information (typically, a
co-located process) could recover a Curve25519 or Curve448 static ECDH key
after inputting a chosen public key and observing the victim performing the
corresponding private-key operation. Found and reported by Leila Batina,
Lukas Chmielewski, Björn Haase, Niels Samwel and Peter Schwabe.
Comment 1 NATTkA bot gentoo-dev 2021-07-29 17:21:06 UTC Comment hidden (obsolete)
Comment 2 NATTkA bot gentoo-dev 2021-07-29 17:29:14 UTC Comment hidden (obsolete)
Comment 3 NATTkA bot gentoo-dev 2021-07-29 17:37:11 UTC Comment hidden (obsolete)
Comment 4 NATTkA bot gentoo-dev 2021-07-29 17:45:15 UTC Comment hidden (obsolete)
Comment 5 NATTkA bot gentoo-dev 2021-07-29 17:53:17 UTC Comment hidden (obsolete)
Comment 6 NATTkA bot gentoo-dev 2021-07-29 18:01:13 UTC Comment hidden (obsolete)
Comment 7 NATTkA bot gentoo-dev 2021-07-29 18:09:33 UTC Comment hidden (obsolete)
Comment 8 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-08-07 17:04:32 UTC
Please proceed with stabilization when ready.
Comment 9 NATTkA bot gentoo-dev 2021-08-07 17:08:23 UTC Comment hidden (obsolete)
Comment 10 NATTkA bot gentoo-dev 2021-08-07 17:16:37 UTC Comment hidden (obsolete)
Comment 11 Anthony Basile gentoo-dev 2021-08-08 19:56:33 UTC
2.16.11 and 2.27.0-r1 are ready.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-19 01:07:32 UTC
x86 done
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-20 23:50:35 UTC
arm done
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-23 00:38:12 UTC
amd64 done
Comment 15 ernsteiswuerfel archtester 2021-08-23 22:31:46 UTC
Looking good on ppc.

mbedtls-2.27.0-r1 fails tests like on amd64 (bug #807154).

 # cat mbedtls-801376.report 
USE tests started on Mo 23. Aug 19:48:17 CEST 2021

FEATURES=' test' USE='' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege programs -static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege programs static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc havege -programs -static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege programs -static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc havege -programs -static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege -programs static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='-doc havege programs static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='-doc -havege -programs -static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='-doc -havege programs -static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege programs -static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege -programs static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc havege -programs static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11

 FEATURES=' test' failed for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege -programs -static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege -programs static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc havege -programs static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc -havege programs -static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege programs -static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc -havege -programs static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege -programs static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc havege programs static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc havege programs -static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc -havege -programs static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc havege -programs static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege programs -static-libs threads zlib' succeeded for =net-libs/mbedtls-2.27.0-r1

revdep tests started on Mo 23. Aug 21:29:07 CEST 2021

FEATURES=' test' USE='mbedtls ssl' succeeded for net-proxy/privoxy
FEATURES=' test' USE='-openssl mbedtls' succeeded for net-vpn/openvpn
FEATURES=' test' USE='mbedtls ssl' succeeded for net-libs/libwebsockets
FEATURES=' test' USE='-gcrypt mbedtls' succeeded for net-libs/libssh2
FEATURES=' test' USE='mbedtls ssl' succeeded for net-misc/curl
FEATURES=' test' USE='-gnutls mbedtls ssl tools' succeeded for dev-libs/libzip
FEATURES=' test' USE='mbedtls' succeeded for www-servers/lighttpd
FEATURES=' test' USE='mbedtls' succeeded for dev-libs/libevent
FEATURES=' test' USE='ssl' succeeded for www-client/dillo
FEATURES=' test' USE='mbedtls' succeeded for net-libs/libssh
FEATURES=' test' USE='mbedtls ssl' succeeded for net-misc/curl
FEATURES=' test' USE='mbedtls' succeeded for dev-libs/libevent
FEATURES=' test' USE='mbedtls ssl' succeeded for net-proxy/privoxy
FEATURES=' test' USE='mbedtls ssl' succeeded for net-libs/libwebsockets
FEATURES=' test' USE='mbedtls' succeeded for net-p2p/transmission
FEATURES=' test' USE='mbedtls' succeeded for www-servers/lighttpd
FEATURES=' test' USE='ssl' succeeded for www-client/dillo
FEATURES=' test' USE='-gcrypt mbedtls' succeeded for net-libs/libssh2
FEATURES=' test' USE='-openssl mbedtls' succeeded for net-vpn/openvpn
FEATURES=' test' USE='-gnutls mbedtls ssl tools' succeeded for dev-libs/libzip
Comment 16 ernsteiswuerfel archtester 2021-08-27 17:41:09 UTC
Looking good on ppc64.

 # cat mbedtls-801376.report 
USE tests started on Fr 27. Aug 15:35:08 CEST 2021

FEATURES=' test' USE='' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege programs static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc havege programs static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc havege -programs -static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='-doc -havege programs static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='-doc -havege programs -static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege -programs static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc -havege programs static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc havege -programs -static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='-doc -havege programs -static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='-doc havege -programs static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='doc havege -programs static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11
USE='-doc havege programs static-libs threads zlib' succeeded for =net-libs/mbedtls-2.16.11

 FEATURES=' test' failed for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege -programs -static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc havege -programs -static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc -havege programs -static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc -havege programs -static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege programs -static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc havege -programs static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc -havege programs static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege programs static-libs -threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc -havege -programs static-libs threads -zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc havege -programs -static-libs -threads zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='-doc -havege -programs -static-libs threads zlib' succeeded for =net-libs/mbedtls-2.27.0-r1
USE='doc havege programs static-libs threads zlib' succeeded for =net-libs/mbedtls-2.27.0-r1

revdep tests started on Fr 27. Aug 17:48:01 CEST 2021

FEATURES=' test' USE='mbedtls ssl' succeeded for net-proxy/privoxy
FEATURES=' test' USE='mbedtls' succeeded for net-p2p/transmission
FEATURES=' test' USE='-gnutls mbedtls ssl tools' succeeded for dev-libs/libzip
FEATURES=' test' USE='-openssl mbedtls' succeeded for net-vpn/openvpn
FEATURES=' test' USE='ssl' succeeded for www-client/dillo
FEATURES=' test' USE='mbedtls' succeeded for net-libs/libssh
FEATURES=' test' USE='-gcrypt mbedtls' succeeded for net-libs/libssh2
FEATURES=' test' USE='mbedtls ssl' succeeded for net-misc/curl
FEATURES=' test' USE='mbedtls' succeeded for dev-libs/libevent
FEATURES=' test' USE='mbedtls' succeeded for www-servers/lighttpd
FEATURES=' test' USE='mbedtls ssl' succeeded for net-misc/curl
FEATURES=' test' USE='-openssl mbedtls' succeeded for net-vpn/openvpn
FEATURES=' test' USE='mbedtls' succeeded for dev-libs/libevent
FEATURES=' test' USE='mbedtls' succeeded for app-crypt/tpm2-tss
FEATURES=' test' USE='-gnutls mbedtls ssl tools' succeeded for dev-libs/libzip
FEATURES=' test' USE='mbedtls' succeeded for net-libs/libssh
FEATURES=' test' USE='ssl' succeeded for www-client/dillo
FEATURES=' test' USE='mbedtls' succeeded for www-servers/lighttpd
FEATURES=' test' USE='mbedtls ssl' succeeded for net-proxy/privoxy
FEATURES=' test' USE='-gcrypt mbedtls' succeeded for net-libs/libssh2
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-27 20:06:22 UTC
ppc64 done
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-27 20:07:44 UTC
ppc done
Comment 19 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-27 20:07:59 UTC
(In reply to ernsteiswuerfel from comment #16)
> Looking good on ppc64.
> 

Thank you for both!
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-04 21:35:46 UTC
arm64 done
Comment 21 NATTkA bot gentoo-dev 2021-09-19 07:16:34 UTC Comment hidden (obsolete)
Comment 22 NATTkA bot gentoo-dev 2021-09-19 13:36:40 UTC Comment hidden (obsolete)
Comment 23 NATTkA bot gentoo-dev 2021-09-20 10:32:36 UTC Comment hidden (obsolete)
Comment 24 Agostino Sarubbo gentoo-dev 2021-10-16 07:22:32 UTC
sparc stable.

Maintainer(s), please cleanup.
Security, please vote.
Comment 25 Larry the Git Cow gentoo-dev 2021-10-19 19:39:56 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cbba573f8561a68fc5ffd554ae72526efa14fd7

commit 1cbba573f8561a68fc5ffd554ae72526efa14fd7
Author:     Jakov Smolić <jsmolic@gentoo.org>
AuthorDate: 2021-10-19 19:29:22 +0000
Commit:     Anthony G. Basile <blueness@gentoo.org>
CommitDate: 2021-10-19 19:39:34 +0000

    net-libs/mbedtls: Security cleanup
    
    Bug: https://bugs.gentoo.org/801376
    Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>
    Signed-off-by: Anthony G. Basile <blueness@gentoo.org>

 net-libs/mbedtls/Manifest               |   2 -
 net-libs/mbedtls/mbedtls-2.16.10.ebuild | 100 -------------------------------
 net-libs/mbedtls/mbedtls-2.26.0.ebuild  | 101 --------------------------------
 3 files changed, 203 deletions(-)
Comment 26 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-10-19 19:44:29 UTC
Thank you!
Comment 27 NATTkA bot gentoo-dev 2021-12-28 15:04:41 UTC
Unable to check for sanity:

> no match for package: net-libs/mbedtls-2.16.11