Issue summary: A server configured with the Suite B certificate flag through
SSL CTX set cert flags() and with TLS 1.3 enabled may read past the end of a
fixed group list when it processes a ClientHello whose supported groups and
key share contain no Suite B group.
Impact summary: A remote client can send a ClientHello that makes the server
read past the end of a static array. The values read are never returned to the
client, so no memory is disclosed; on builds with sanitizers or hardened
allocators the read may crash the process, causing Denial of Service.
CWE: CWE-125: Out-of-bounds Read
Description: When the Suite B certificate flag is set, OpenSSL restricts the
accepted groups to P-256 and P-384 by substituting a fixed two-element list
for the configured group list. The tuple machinery used for key-share
selection was not updated for this substitution: tls1 get group tuples() still
returns the configured tuples, which by default describe eight groups. The
server-side walk in tls parse ctos key share() then advances through the
two-element list using those tuple counts without checking the cumulative
offset against the number of groups present.
Only applications that call SSL CTX set cert flags() with
SSL CERT FLAG SUITEB 128 LOS and leave TLS 1.3 enabled are affected. The
openssl s server -suiteB 128 option sets an X.509 verification parameter
instead, so the stock command line server is not vulnerable. Default
configurations do not reach this code.
A client that offers only groups outside the Suite B set, such as X25519,
forces every tuple to be walked and the read to run past the array. The bytes
read are compared against client group IDs and never sent back, so no memory
is disclosed. On builds with address sanitizers or hardened allocators the
read can abort the process; in ordinary release builds it reads a few bytes of
adjacent constant data.
FIPS impact: no
The affected code is outside the FIPS module boundary.