Closed code423n4 closed 2 years ago
We are utilizing CErc20Immutable just as provided in Compound. Admin is not meant to change under immutable. Agreed though for clarity we should either add transferring or remove the accept admin function.
Duplicate of #29
Lines of code
https://github.com/code-423n4/2022-04-dualityfocus/blob/f21ef7708c9335ee1996142e2581cb8714a525c9/contracts/compound_rari_fork/CToken.sol#L1379
Vulnerability details
Impact
The
CToken
implements an_acceptAdmin
function that sets the newadmin
to thependingAdmin
. ButCToken
does not implement a_setPendingAdmin
function to set thependingAdmin
in the first place. Therefore, the_acceptAdmin
function is useless andCToken
s can never change their admin, breaking the desired functionality.Recommended Mitigation Steps
Add a
_setPendingAdmin
function toCToken
as inUniTroller
or remove the_acceptAdmin
function if the admin should never be changed.