Skip to content

Conversation

@jclapis
Copy link
Collaborator

@jclapis jclapis commented Aug 12, 2025

⚠️ Do not merge unntil #354 and #353 are in!

This is part 2 of the update on CBST2-01, following #354 and #353. This solves one of the issues found within the audit by making all of the routes with a request body (e.g., the POST routes) encode the Keccak256 hash of the payload body into the JWT claims for the request's auth header. Doing so means JWTs can't be intercepted and reused for unrelated requests, such as for signing different things other than what the original request was for. This affects all routes, including the new /revoke_jwt and /reload ones.

ltitanb and others added 30 commits May 13, 2025 17:17
The token **must include** the following claims:
- `exp` (integer): Expiration timestamp
- `module` (string): The ID of the module making the request, which must match a module ID in the Commit-Boost configuration file.
- `payload_hash` (string): The Keccak-256 hash of the JSON-encoded request body, with optional `0x` prefix. This is required to prevent JWT replay attacks.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Json is not an ideal serialization format to hash, let's use ssz with the nonce and object root. As an optimization, we could re use that root directly when providing the signature

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, but note that this isn't exclusive to signing requests - any request made to the server with a body (e.g., any request that uses POST) needs to do this, which means we need to define SSZ types for every request and have the user conform to those.

Base automatically changed from augment-sign-requests to sigp-audit-fixes August 19, 2025 19:11
@jclapis jclapis marked this pull request as ready for review September 2, 2025 03:57
@jclapis jclapis merged commit 52aec57 into sigp-audit-fixes Sep 2, 2025
1 check passed
@jclapis jclapis deleted the add-payload-hash-to-jwt branch September 2, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core part of the repo (signer, modules interface)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants