Skip to content

Only accept revocation reasons 0, 1, 3, 4, 5 and 9 - #558

Open
Preston12321 wants to merge 1 commit into
revocation-race-fixfrom
reason-code-allowlist
Open

Preston12321 wants to merge 1 commit into
revocation-race-fixfrom
reason-code-allowlist

Conversation

@Preston12321

@Preston12321 Preston12321 commented Sep 27, 2026 •

Copy link
Copy Markdown

Replace the check for reasons 7 and >10 with an allowlist. This also rejects cACompromise (2), which applies only to CA certificates; certificateHold (6), which the Baseline Requirements forbid; removeFromCRL (8), which is only allowed in delta CRLs; and aACompromise (10), which applies only to attribute authorities.

Note: This change is entirely generated by Claude, but I provided significant guidance and have manually reviewed the diff

Replace the check for reasons 7 and >10 with an allowlist. This also
rejects cACompromise (2), which applies only to CA certificates;
certificateHold (6), which the Baseline Requirements forbid;
removeFromCRL (8), which is only allowed in delta CRLs; and aACompromise
(10), which applies only to attribute authorities.
@Preston12321
Preston12321 added this pull request to stack #559 September 27, 2026 03:42
@Preston12321
Preston12321 marked this pull request as ready for review September 27, 2026 04:06
Comment thread wfe/wfe.go
Comment on lines +166 to +170
// - 2 (cACompromise) applies only to CA certificates.
// - 6 (certificateHold) is forbidden by the Baseline Requirements.
// - 7 is unused, and codes above 10 are undefined.
// - 8 (removeFromCRL) is only allowed in delta CRLs (RFC 5280 Section 5.3.1).
// - 10 (aACompromise) applies only to attribute authorities.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is extra fluff, we already know what we accept so we shouldn't need to track what we don't accept. Delete this please.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Also potentially worth noting the ways in which this list (purposefully!) differ's from Boulder's allowlist. Boulder does not permit affiliationChanged (because it's irrelevant to DV certs) and privilegeWithdrawn (because only the CA can request that code). Having pebble accept those two is good (we like pebble behaving differently from Boulder), but it's nice to note the divergence so people don't think it's a bug.

Comment thread wfe/wfe_test.go

func TestProcessRevocationReasons(t *testing.T) {
badReasonType := acme.BadRevocationReasonProblem("").Type
for reason := range uint(12) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what this is doing, but this test feels weird to me and required a several doubletakes.

Comment thread wfe/wfe.go
// - 7 is unused, and codes above 10 are undefined.
// - 8 (removeFromCRL) is only allowed in delta CRLs (RFC 5280 Section 5.3.1).
// - 10 (aACompromise) applies only to attribute authorities.
var validRevocationReasons = map[uint]struct{}{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: its slightly better to do this as a function with a switch/case inside it. The issue with the map approach is that maps aren't immutable; some code very far from here could accidentally edit the contents of this map. But for pebble it doesn't matter that much, so feel free to disregard this nit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants