Skip to content

wfe: use RFC 8555 problem types for url and CSR identifier mismatches - #582

Open
thedaemon-wizard wants to merge 2 commits into
letsencrypt:mainfrom
thedaemon-wizard:rfc8555-problem-types
Open

thedaemon-wizard wants to merge 2 commits into
letsencrypt:mainfrom
thedaemon-wizard:rfc8555-problem-types

Conversation

@thedaemon-wizard

Copy link
Copy Markdown

Fixes #581.

  • A JWS whose url header parameter is not the request URL now gets unauthorized (403) instead of malformed (400). RFC 8555 section 6.4 says the server "MUST reject the request as unauthorized".
  • A finalize request whose CSR identifiers differ from the order's (a different or missing DNS name or IP address, or a different number of either) now gets badCSR (400) instead of unauthorized (403), as section 7.4 says the problem document SHOULD use.

The checks of the inner JWS of a key rollover are unchanged.

Tests: TestURLMismatchIsUnauthorized and TestFinalizeWithDifferentIdentifiersIsBadCSR (four cases) fail on main and pass here. Also checked locally: go test -race ./..., golangci-lint v2.12.2 with Go 1.25.0 (0 issues), and the eggsampler/acme test suite against this build (all pass).

A JWS whose "url" header parameter is not the request URL is now
rejected as unauthorized instead of malformed. RFC 8555 Section 6.4:
"If the two do not match, then the server MUST reject the request as
unauthorized."

A finalize request whose CSR identifiers differ from the order's now
gets badCSR instead of unauthorized, as Section 7.4 says the problem
document SHOULD use for that case. This covers a different or missing
DNS name or IP address, and a different number of either.

The checks of the inner JWS of a key rollover are unchanged.

Fixes letsencrypt#581
Comment thread wfe/wfe.go Outdated
Comment on lines +962 to +963
// RFC 8555 Section 6.4: "If the two do not match, then the server MUST
// reject the request as unauthorized."

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.

I think this comment is unnecessary; a reader won't read this and wonder "why are they using Unauthorized here?".

Suggested change
// RFC 8555 Section 6.4: "If the two do not match, then the server MUST
// reject the request as unauthorized."

Comment thread wfe/wfe.go Outdated
Comment on lines +2223 to +2225
// RFC 8555 Section 7.4: when the CSR and order identifiers differ, the
// problem document SHOULD use error code "badCSR".

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.

Same here, especially detached from the places where BadCSRProblem is actually being returned.

Suggested change
// RFC 8555 Section 7.4: when the CSR and order identifiers differ, the
// problem document SHOULD use error code "badCSR".

@aarongable
aarongable requested review from a team and aarongable and removed request for a team December 3, 2026 02:03
@thedaemon-wizard

Copy link
Copy Markdown
Author

Thanks, both comments are removed.

The eggsampler/acme job stops before any test runs: eggsampler/acme has required Go 1.26 since eggsampler/acme@f5ffad2 (2 December), and this job runs Go 1.25.0 with GOTOOLCHAIN=local. It fails the same way on main: https://github.com/letsencrypt/pebble/actions/runs/46974592799

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.

Problem types for a url mismatch and for CSR identifiers that differ from the order

2 participants