Platform: Code4rena
Start Date: 08/09/2023
Pot Size: $70,000 USDC
Total HM: 8
Participants: 84
Period: 6 days
Judge: gzeon
Total Solo HM: 2
Id: 285
League: ETH
Rank: 39/84
Findings: 1
Award: $132.86
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Kow
Also found by: 0xRobsol, 0xfuje, 0xkazim, 0xpiken, Aymen0909, T1MOH, bin2chen, codegpt, gumgumzum, josephdara, lsaudit, nmirchev8, ravikiranweb3, rvierdiiev
132.8565 USDC - $132.86
The _calculateDomainSeparator function generates the EIP-712 domain separator using the contract's name and version. However, there is no explicit guarantee that the name has been set before calling this function, leading to an unreliable domain separator.
The domain separator is a fundamental component in verifying the source and integrity of off-chain signed messages in the EIP-712 standard. If the domain separator is not consistently and correctly generated, it could result in:
Users signing messages that they didn't intend to, because the domain they thought they were interacting with is different. A loss of trust in the protocol's message verification system. Potential vulnerabilities where malicious actors could exploit the inconsistency to impersonate the contract or deceive users.
Consider a situation where Alice wants to sign a message to prove her actions off-chain for this contract. Alice fetches the domain separator to sign her message.
If the name hasn't been set before she calls _calculateDomainSeparator, she might sign a message with a domain that doesn't represent the intended contract. This could be problematic in scenarios where Bob, another user, uses the signed message to interact with the contract.
Without a correct domain separator, Alice's intent is misrepresented. Anyone using her signature might end up making decisions based on incorrect information.
Add a modifier or check to ensure that name is set before the _calculateDomainSeparator function can be called.
Access Control
#0 - c4-pre-sort
2023-09-16T01:33:53Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2023-09-16T01:34:04Z
raymondfam marked the issue as duplicate of #146
#2 - c4-judge
2023-09-26T18:07:11Z
gzeon-c4 marked the issue as satisfactory