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

[Informational] Missing zero checks in the constructor of `bridge.ciaro` contract

Summary

The constructor function in the bridge.cairo initializes the contract state, setting up essential addresses and configuration parameters. It ensures that the contract is correctly set up with administrative and bridge addresses, along with class hash information for ERC721 tokens. There is no zero address check for the address passed.

Issues Identified:

Zero Address Check: The bridge_admin address is not validated for a zero address. Using a zero address could lead to security risks or functionality issues.
Bridge Address Check: The bridge_l1_address should be validated to ensure it is not zero to prevent potential misconfigurations or misuse.

Impact

Severity : Informational

Zero Address Risk: If bridge_admin or bridge_l1_address is a zero address, it could result in:

Loss of control over administrative functions.
Inability to properly route bridge transactions.
Potential security vulnerabilities if functions relying on these addresses are not safeguarded.
Contract Misconfiguration: Initializing with a zero address could lead to malfunctioning of contract operations, including the ERC721 bridging functionality, potentially impacting the entire bridge operation.

Recommendations

Add Zero Address Checks:

assert!(bridge_admin != ContractAddress::zero(), "bridge_admin cannot be zero address");
assert!(bridge_l1_address != EthAddress::zero(), "bridge_l1_address cannot be zero address");
Updates

Lead Judging Commences

n0kto Lead Judge 9 months 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.