Skip to content

Conversation

@ScreamingHawk
Copy link
Contributor

S-470 Signature Validation Permanently Bricked by Stale chainid in DOMAIN_SEPARATOR

https://code4rena.com/audits/2025-11-sequence-transaction-rails/submissions/S-470

Issue: Chain id is hashed and cached, causing issues if chain ever updates the chain id.

Analysis: If a chain ever forks and updates it's chain id the new chain will continue to expect the old chain id. This is a very unlikely scenario, however as we work with new custom chain provider we have had clients suggest such an approach to fix state issues.

Fix: Calculate domain separator using chain id at runtime.

Note: I've retained the function DOMAIN_SEPARATOR() public for backwards compatibility with integrations. This is probably not necessary

@ScreamingHawk ScreamingHawk requested a review from a team November 26, 2025 19:00
Copy link
Collaborator

@shunkakinoki shunkakinoki left a comment

Choose a reason for hiding this comment

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

LGTM 🙏

Copy link
Member

@Agusx1211 Agusx1211 left a comment

Choose a reason for hiding this comment

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

LGTM too

@shunkakinoki shunkakinoki merged commit 7a45b1e into master Nov 27, 2025
1 check passed
@shunkakinoki shunkakinoki deleted the c4-s470 branch November 27, 2025 12:16
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.

4 participants