NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

_whiteListCollection function lacks return value for operation status

Summary

_whiteListCollection function lacks return value for operation status.

Vulnerability Details

The internal function _whiteListCollection in the smart contract, which is responsible for managing the whitelist status of collections, does not return any value to indicate the success or failure of the whitelisting operation when whitelist function is called.

function whiteList(address collection, bool enable) external onlyOwner {
_whiteListCollection(collection, enable);
emit CollectionWhiteListUpdated(collection, enable);
}
function _whiteListCollection(address collection, bool enable) internal {
if (enable && !_whiteList[collection]) {
bool toAdd = true;
uint256 i = 0;
while(i < _collections.length) {
if (collection == _collections[i]) {
toAdd = false;
break;
}
i++;
}
if (toAdd) {
_collections.push(collection);
}
}
_whiteList[collection] = enable;
}

https://github.com/Cyfrin/2024-07-ark-project/blob/273b7b94986d3914d5ee737c99a59ec8728b1517/apps/blockchain/ethereum/src/Bridge.sol#L284C4-L287C6

https://github.com/Cyfrin/2024-07-ark-project/blob/273b7b94986d3914d5ee737c99a59ec8728b1517/apps/blockchain/ethereum/src/Bridge.sol#L340C4-L356C6

This omission can lead to silent failures and make it difficult for whitelist function to determine if the whitelisting action was completed successfully.

Impact

Undetected failures in whitelisting operations.

Tools Used

Manual review

Recommendations

Modify the function to return a boolean value indicating the success of the operation.

Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.