]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.21] crypto/tls: restrict RSA keys in certificates to <= 8192...
authorRoland Shoemaker <bracewell@google.com>
Wed, 7 Jun 2023 22:27:13 +0000 (15:27 -0700)
committerDavid Chase <drchase@google.com>
Tue, 1 Aug 2023 21:58:27 +0000 (21:58 +0000)
commita51957fb0b20bb6c91d0415efca222cc9ecdb770
tree68eccb4dafc68d5f2edc62c7ca9b15876eca3fb5
parent363f2594aabc2ae4ef326e5c2691fd0ebb14390e
[release-branch.go1.21] crypto/tls: restrict RSA keys in certificates to <= 8192 bits

Extremely large RSA keys in certificate chains can cause a client/server
to expend significant CPU time verifying signatures. Limit this by
restricting the size of RSA keys transmitted during handshakes to <=
8192 bits.

Based on a survey of publicly trusted RSA keys, there are currently only
three certificates in circulation with keys larger than this, and all
three appear to be test certificates that are not actively deployed. It
is possible there are larger keys in use in private PKIs, but we target
the web PKI, so causing breakage here in the interests of increasing the
default safety of users of crypto/tls seems reasonable.

Thanks to Mateusz Poliwczak for reporting this issue.

Updates #61460
Fixes CVE-2023-29409

Change-Id: Ie35038515a649199a36a12fc2c5df3af855dca6c
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1912161
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
(cherry picked from commit d865c715d92887361e4bd5596e19e513f27781b7)
Reviewed-on: https://go-review.googlesource.com/c/go/+/515056
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_client_test.go
src/crypto/tls/handshake_server.go