Closed sherlock-admin4 closed 8 months ago
2 comment(s) were left on this issue during the judging contest.
WangAudit commented:
invalid; owners/admins are trusted
takarez commented:
valid; this should be a dupp of 002 due to the same underlying cause of having previlage to interact with tokens even after blacklsiting; high(1)
neocrao
high
A blacklisted address can still hold privileged role such as MINTER, BURNER, SUPPORT, and BLACKLISTER, and still act maliciously
Summary
The protocol has privileged roles: MINTER, BURNER, SUPPORT, and BLACKLISTER. An address can have these roles, and get blacklisted, and yet retain these roles. This gets more interesting when the user being blacklisted is the blacklister, as then the user can remove themselves from being blacklisted. Also, if the blacklisted user still retains the minter/burner role, then they can still act maliciously, which is something the protocol tried to mitigate using the blacklisted role.
Links to affected code
https://github.com/sherlock-audit/2024-02-telcoin-platform-audit-update/blob/main/telcoin-contracts/contracts/util/abstract/Blacklist.sol#L101
https://github.com/sherlock-audit/2024-02-telcoin-platform-audit-update/blob/main/telcoin-contracts/contracts/util/abstract/Blacklist.sol#L32
https://github.com/sherlock-audit/2024-02-telcoin-platform-audit-update/blob/main/telcoin-contracts/contracts/stablecoin/Stablecoin.sol#L123
https://github.com/sherlock-audit/2024-02-telcoin-platform-audit-update/blob/main/telcoin-contracts/contracts/stablecoin/Stablecoin.sol#L31-L33
Vulnerability Detail
The
Stablecoin
contract has the following behaviours defined:Furthermore, the
Stablecoin
README says:The contract further defines these roles: MINTER, BURNER, SUPPORT, and BLACKLISTER. The roles are used to interact with the access controlled functions:
mint()
- MINTERmintTo()
- MINTERburn()
- BURNERburnFrom()
- BURNERerc20Rescue()
- SUPPORTaddBlackList()
- BLACKLISTERremoveBlackList()
- BLACKLISTERHowever, when the address is blacklisted, the roles are not cleared for the address being blacklisted.
Impact
If the address that is being blacklisted has one of the privileged roles, then the blacklisted user can still act maliciously and exploit the privileged role.
If the address had BLACKLISTER role, then they can even remove themselves (and others) from the blacklist, and rather blacklist everyone else.
Code Snippet
Place the below code in
test/stablecoins/Stablecoin.test.ts
:Tool used
Manual Review
Recommendation
When adding a user to the blacklist, take away all the privileged role that have been granted to the user as well.