code-423n4 / 2022-04-dualityfocus-findings

1 stars 0 forks source link

Unauthorized ERC20 changes #7

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/code-423n4/2022-04-dualityfocus/blob/f21ef7708c9335ee1996142e2581cb8714a525c9/contracts/compound_rari_fork/CToken.sol#L1641

Vulnerability details

Impact

It's possible by anyone to change the name and symbol of CToken.

Proof of Concept

The require was made in reverse condition, it checks that the sender must be different than admin in order to be able to change the name and symbol

require(msg.sender != admin, "caller not admin");

The effects that the token can be altered by a third party, can lead to loss of reliability in the project and consequently loss of investors.

Recommended Mitigation Steps

Change to: require(msg.sender == admin, "caller not admin");

0xdramaone commented 2 years ago

Duplicate of #25