request to deposit or redeem with permit may not work as expected if ERC20 token name is updated #52
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-146
low quality report
This report is of especially low quality
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-09-centrifuge/blob/main/src/token/ERC20.sol#L67-L77
https://github.com/code-423n4/2023-09-centrifuge/blob/main/src/LiquidityPool.sol#L220-L226
https://github.com/code-423n4/2023-09-centrifuge/blob/main/src/LiquidityPool.sol#L237-L243
https://github.com/code-423n4/2023-09-centrifuge/blob/main/src/token/ERC20.sol#L216-L237
Vulnerability details
Impact
Depositing or redeeming with permit may stop working, if the token name is updated.
The digest generation in the permit function of ERC20 takes into account the name of the ERC20 token at the time of generation.
Updating the name of such token with new name using file function could break the signature digests and will not work.
Proof of Concept
Refer to the digest generation in the below function in LiquidityPool comtract.
note how value returned by _calculateDomainSeparator() function above is part of the digest.
Note how name is part of the keccack256 which is part of the digest. As such update the name of the ERC20 token will invalidate the digests.
Tools Used
Manual Review
Recommended Mitigation Steps
Assign the name of the token during token in the construction and dont prove a way to change the name later.
Assessed type
ERC20
The text was updated successfully, but these errors were encountered: