[go] crypto/x509: fix signature checking limit

0 views
Skip to first unread message

Roland Shoemaker (Gerrit)

unread,
2:02 PM (9 hours ago) 2:02 PM
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Neal Patel, Jakub Ciolek, Damien Neil, Go LUCI, golang-co...@googlegroups.com

Roland Shoemaker submitted the change

Change information

Commit message:
crypto/x509: fix signature checking limit

We added the "is this cert already in the chain" check (alreadyInChain)
to considerCandidates before the signature limit. considerCandidates
bails out when we exceed the signature check, but buildChains keeps
calling considerCandidates until it exhausts all potential parents. In
the case where a large number of certificates look to have signed each
other (e.g. all have subject==issuerSubject and the same key),
alreadyInChain is not particularly cheap, meaning even though we hit our
"this is too much work" limit, we still do a lot of work.

Move alreadyInChain after the signature limit, and also return a
sentinel error, and check it in buildChains so we can break out of the
loop early if we aren't actually going to do any more work.

Thanks to Jakub Ciolek for reporting this issue.

Fixes #78282
Fixes CVE-2026-32280
Change-Id: Ie6f05c6ba3b0a40c21f64f7c4f846e74fae3b10e
Reviewed-by: Damien Neil <dn...@google.com>
Reviewed-by: Neal Patel <neal...@google.com>
Reviewed-by: Jakub Ciolek <ja...@ciolek.dev>
Files:
  • M src/crypto/x509/verify.go
  • M src/crypto/x509/verify_test.go
Change size: M
Delta: 2 files changed, 96 insertions(+), 85 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Damien Neil, +1 by Jakub Ciolek, +2 by Neal Patel
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie6f05c6ba3b0a40c21f64f7c4f846e74fae3b10e
Gerrit-Change-Number: 758320
Gerrit-PatchSet: 2
Gerrit-Owner: Roland Shoemaker <rol...@golang.org>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Jakub Ciolek <ja...@ciolek.dev>
Gerrit-Reviewer: Neal Patel <neal...@google.com>
Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages