Skip to content

Fix wildcard authorization reuse with DNS-Account-01#14

Closed
sheurich wants to merge 3 commits intomainfrom
fix-wildcard-dns-account-01-reuse
Closed

Fix wildcard authorization reuse with DNS-Account-01#14
sheurich wants to merge 3 commits intomainfrom
fix-wildcard-dns-account-01-reuse

Conversation

@sheurich
Copy link
Owner

@sheurich sheurich commented Nov 25, 2025

Summary

The RA rejected wildcard authorizations with DNS-Account-01 challenges during reuse. This fix accepts both DNS-01 and DNS-Account-01 for wildcard authorization reuse.

Root Cause

In ra/ra.go:2244-2248, the NewOrder() validation only accepted DNS-01 for wildcards. This check was added in commit 52615d9 before DNS-Account-01 wildcard support existed.

Changes

  • Updated validation to accept both DNS-01 and DNS-Account-01 for wildcards
  • Split validation into two checks (wrong count vs wrong type) with better error messages
  • Added TestNewOrderAuthzReuseDNSAccount01 unit test
  • Added TestDNSAccount01WildcardAuthorizationReuse integration test

Why Tests Missed This

The bug only affects authorization reuse, not new authorizations. Existing tests use random domains for each order, preventing reuse.

Test Coverage

Unit test: TestNewOrderAuthzReuseDNSAccount01 verifies the validation logic accepts DNS-Account-01

Integration test: TestDNSAccount01WildcardAuthorizationReuse verifies end-to-end authorization reuse:

  • Creates a wildcard order with DNS-Account-01
  • Completes the challenge to get a valid authorization
  • Creates a second order for the same wildcard domain
  • Verifies the same authorization is reused
  • Verifies no re-validation occurs

This is the first Go integration test to explicitly verify authorization reuse in Boulder.

The RA rejected wildcard authorizations with DNS-Account-01 challenges
during reuse, though the PA offers DNS-Account-01 for wildcards.

In ra.go:2244-2248, the NewOrder() validation only accepted DNS-01 for
wildcards. This check predates DNS-Account-01 wildcard support (added
after commit 52615d9).

Changes:
- Accept both DNS-01 and DNS-Account-01 for wildcard reuse
- Split validation into two checks (count vs type)
- Add TestNewOrderAuthzReuseDNSAccount01 unit test

The bug only affected authorization reuse (not new authorizations),
which is why existing tests using random domains didn't expose it.
Adds TestDNSAccount01WildcardAuthorizationReuse to verify that wildcard
authorizations with DNS-Account-01 challenges can be reused correctly.

The test:
- Creates a wildcard order with DNS-Account-01
- Completes the challenge to get a valid authorization
- Creates a second order for the same wildcard domain
- Verifies the same authorization is reused (same URL)
- Verifies the authorization is already valid (no re-validation)
- Verifies the DNS-Account-01 challenge type is preserved

This test fills a gap in Boulder's integration test coverage - no
existing Go integration tests verify authorization reuse end-to-end.
Reverted to single combined check to maintain backward compatibility
with existing test expectations. The fix still accepts both DNS-01 and
DNS-Account-01 for wildcard authorization reuse, but uses the original
generic error message format: "with invalid challenge(s)"

This avoids needing to modify existing tests while still fixing the bug.
@sheurich sheurich closed this Nov 25, 2025
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.

1 participant