caddyserver / caddyserver/certmagic

Consider performing sanity check on newly obtained certificates

Open
#240 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion
Dominant language
Go
Stars
5.6k
Forks
354
Avg merge
9d 23h
Merged PRs (30d)
3

Description

Today's (relatively minor) Let's Encrypt incident (more info on HN - and on LE forums) makes me wonder if we should perform some checks on the certificates in case CAs have bugs that would cause browsers to reject the certs.

This function can probably get us a long way: https://pkg.go.dev/crypto/x509#Certificate.Verify - realizing that not all certificates trusted on the server will be trusted on clients.

This linter library can perhaps be helpful: https://pkg.go.dev/github.com/zmap/zlint#LintCertificate

In particular, today's incident involved invalid SCT signatures. Verifying this would probably involve calling out to some CT log. 😕

These kinds of bugs are very rare I think.

In fact, most CAs are/should be linting their certificates before issuing them... the reason today's incident wasn't caught was because this particular check does require an external resource.

So I dunno. I feel like it could be useful to have a mode (maybe optional? at least to start) that would vet all obtained certificates and, if the configured checks fail, move onto the next CA and get a certificate from that one instead.

Opening this issue for a discussion.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or entry points are named. Start by reading crypto/x509.Certificate.Verify and github.com/zmap/zlint LintCertificate, then trace how certificates are obtained. Done would require a defined optional vetting mode, clear checks, and documented behavior when a certificate fails them.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.