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: 41/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
https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/token/ERC20.sol#L84 https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/token/ERC20.sol#L48
This report addresses an issue in the ERC20 token implementation, specifically concerning the ability to change the token's name and symbol. While the implementation adheres to the EIP 712 standard for signing permit functions, it has a crucial flaw related to the handling of the token's name. The issue arises when the token's name is changed after the initial setup, leading to incorrect calculations within the DOMAIN_SEPARATOR of the contract. Consequently, this impacts the ability to recover signatures correctly, causing potential failures during signature verification.
Something more - current implementation uses empty string for name
in the DOMAIN_SEPARATOR, because of the factory implementation.
The impact of this issue is not considered high in terms of security, as it does not compromise the integrity of the token's funds or directly expose vulnerabilities to malicious actors. However, it does introduce undesirable consequences. Changing the name of a token should ideally result in the recalibration of the DOMAIN_SEPARATOR to maintain consistency. Failing to do so creates confusion and breaks the standard defined by EIP 712.
The EIP 712 standard specifies that the 'domainName' field within domainSeparator should represent the user-readable name of the signing domain, which includes the DApp or protocol name. When the token's name is changed without updating the DOMAIN_SEPARATOR, it deviates from this standard.
NOTE: 1 and 2 from below are different scenarios and for current implementation 1st will always override 2nd
decimals
If the token's name is subsequently changed using file function
In this scenario, if the original name of the token was "Test token" and it was later changed to "Better name token," a signer would utilise "Better name token" for the domainName value in the hash struct used for the domainSeparator. This change could lead to a perpetual failure in the ecrecover signature verification process, if the signer follows EIP712 standard process, even if all other data remains valid.
Manual Review
ERC20
#0 - c4-pre-sort
2023-09-15T16:27:04Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2023-09-15T16:27:16Z
raymondfam marked the issue as duplicate of #146
#2 - c4-judge
2023-09-26T18:07:35Z
gzeon-c4 marked the issue as satisfactory