Skip to content

fix(acme): reject General JWS serialization (#2642) - #2798

Open
Tyagiquamar wants to merge 1 commit into
smallstep:masterfrom
Tyagiquamar:fix-acme-reject-general-jws-2642
Open

Tyagiquamar wants to merge 1 commit into
smallstep:masterfrom
Tyagiquamar:fix-acme-reject-general-jws-2642

Conversation

@Tyagiquamar

Copy link
Copy Markdown

Rejects ACME POST bodies using the General JWS JSON Serialization. RFC 8555 Section 6.2 requires the Flattened JSON Serialization, but parseJWS accepted the General form because go-jose ParseSigned parses both, and a single-signature General JWS also passed the more-than-one-signature check in validateJWS. The middleware now returns a malformed error for bodies carrying a top-level signatures member before parsing.

Fixes #2642.

Verification (all in golang:1.26-bookworm, matching go.mod go 1.26.0):

  • gofmt -l acme/api/ -> no output, exit 0
  • go vet ./acme/api/ -> exit 0
  • go build ./acme/... -> exit 0
  • go test ./acme/... -count=1 -> ok all 4 packages (acme, acme/api, acme/db/nosql, acme/wire), exit 0
  • New TestHandler_parseJWS/fail/general-jws-serialization case fails without the fix (General JWS accepted) and passes with it.

ACME requests MUST use the Flattened JSON Serialization (RFC 8555,
Section 6.2), but parseJWS accepted the General serialization
(RFC 7515, Section 7.2.1) because go-jose parses both. A
single-signature General JWS also slipped past the more-than-one
signature check in validateJWS, so reject bodies carrying a top-level
signatures member before parsing.

Fixes smallstep#2642
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Tyagiquamar seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the needs triage Waiting for discussion / prioritization by team label Sep 16, 2026
@Tyagiquamar

Copy link
Copy Markdown
Author

Hi, just following up on this when you get a chance. The branch is up to date and checks are green. If it looks good from your side, it should be ready to merge. Happy to make any changes if needed. Thanks!

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

Labels

needs triage Waiting for discussion / prioritization by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Step-CA accepts non-flattened JWS POST requests

3 participants