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

Missing address(0) check in set_l1_l2_collection_mapping

Summary

address(0) can be passed to either one of the collections which can cause a loss of assets.

Vulnerability Details

If admin passes address(0) as an argument to one of the mappings, for example, collection_l2, this will deploy new ERC721 instead of using the old one.

fn set_l1_l2_collection_mapping(ref self: ContractState, collection_l1: EthAddress, collection_l2: ContractAddress) {
ensure_is_admin(@self);
self.l1_to_l2_addresses.write(collection_l1, collection_l2);
self.l2_to_l1_addresses.write(collection_l2, collection_l1);
}

Impact

address(0) can be passed to mapping

Tools Used

Manual Review

Recommendations

add check preventing admin for providing address(0) as mapping value.

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.