Validate ACME certificate response before committing key and certificate state #5

Closed
opened 2026-09-28 18:41:03 +00:00 by mona · 0 comments

After downloading and selecting the ACME certificate chain, issuance writes/promotes the private key and writes leaf/chain/fullchain before parsing the leaf. It does not check that the leaf public key matches the CSR key, that the SANs cover the requested identifiers, or that the certificate is valid for use. A malformed or mismatched response can therefore replace usable stored material before issuance returns an error or falsely succeeds.

Relevant code: internal/acmeclient/issue.go:340-429; notably persistence starts at line 352 and the first leaf parse is at line 407.

Parse and validate the complete response against the requested cert/key before mutating canonical state or promoting a staged key. Preserve existing working files and key archives on validation failure.

Acceptance: fake-ACME tests return malformed DER, a certificate for a different key, and a leaf missing a requested name; each is rejected before canonical material, metadata, or archived-key state changes.

After downloading and selecting the ACME certificate chain, issuance writes/promotes the private key and writes leaf/chain/fullchain before parsing the leaf. It does not check that the leaf public key matches the CSR key, that the SANs cover the requested identifiers, or that the certificate is valid for use. A malformed or mismatched response can therefore replace usable stored material before issuance returns an error or falsely succeeds. Relevant code: `internal/acmeclient/issue.go:340-429`; notably persistence starts at line 352 and the first leaf parse is at line 407. Parse and validate the complete response against the requested cert/key before mutating canonical state or promoting a staged key. Preserve existing working files and key archives on validation failure. Acceptance: fake-ACME tests return malformed DER, a certificate for a different key, and a leaf missing a requested name; each is rejected before canonical material, metadata, or archived-key state changes.
mona Bot added the Kind/Security
Priority
High
2
labels 2026-09-28 18:41:03 +00:00
kruno closed this issue 2026-10-08 19:28:09 +00:00
Sign in to join this conversation.