Submitted by cccz
MaltRepository inherits from AccessControl and adds validation of validRoles to the hasRole function, which means that even if super.hasRole(role, account) == true, if validRoles[role] == false hasRole will return false, which will cause \_revokeRole to not work correctly.
Consider the case where Alice is granted ADMINROLE, then ADMINROLE is removed in the removeRole function, validRoles[ADMIN_ROLE] == false.
Now if the revokeRole function is called on Alice, in the \_revokeRole, since hasRole returns false, Alices ADMIN_ROLE will not be revoked.
Since removeRole ends silently, this may actually cause the caller to incorrectly assume that Alices ADMIN_ROLE has been revoked:
In addition, the renounceRole and \_transferRole functions will also be affected.
In particular, the \_transferRole function, if you want to transfer Alices role to Bob, both Alice and Bob will have the role if validRoles[role]==false.
https://github.com/code-423n4/2023-02-malt/blob/700f9b468f9cf8c9c5cffaa1eba1b8dea40503f9/contracts/Repository.sol#L64-L74 
https://github.com/code-423n4/2023-02-malt/blob/700f9b468f9cf8c9c5cffaa1eba1b8dea40503f9/contracts/Repository.sol#L99-L102
Override renounceRole and removeRole in the MaltRepository and modify them as follows:
0xScotch (Malt) confirmed
For this contest, 4 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by hansfriese received the top score from the judge.
The following wardens also submitted reports: minhquanym, cccz, and KingNFT
.
