You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function marketWhitelistCheck of RCTreasury checks the variable marketWhitelist.
However marketWhitelist is never set in the code base so calling marketWhitelistCheck is not useful.
Note: there are 2 whitelist mechanisms:
toggleWhitelist / batchWhitelist
marketWhitelistCheck
This might be the reason why this issue wasn't detected earlier.
Handle
gpersoon
Vulnerability details
Impact
The function marketWhitelistCheck of RCTreasury checks the variable marketWhitelist.
However marketWhitelist is never set in the code base so calling marketWhitelistCheck is not useful.
Note: there are 2 whitelist mechanisms:
This might be the reason why this issue wasn't detected earlier.
Proof of Concept
//https://github.com/code-423n4/2021-08-realitycards/blob/main/contracts/RCTreasury.sol#L269
function marketWhitelistCheck(address _user) external view override returns (bool) {
bytes32 requiredRole = marketWhitelist[msgSender()];
if (requiredRole == bytes32(0)) {
return true;
} else {
return hasRole(requiredRole, _user);
}
}
Tools Used
Recommended Mitigation Steps
Add a function to set marketWhitelist (or remove marketWhitelistCheck)
Add comments to show there are two whitelist mechanisms.
Rename toggleWhitelist / batchWhitelist to toggleUrerWhitelist / batchUserWhitelist
The text was updated successfully, but these errors were encountered: