The initialize
function in Bridge.sol can be called multiple times, which leads to potential unintended state changes or vulnerabilities. Initialization functions should only be callable once to prevent reinitialization risks.
Location: Bridge.sol
at line 44:
Issue: The initialize function, intended to set up initial state variables, can be called multiple times. This can lead to unpredictable outcomes, such as state corruption or unauthorized state changes.
Severity: Low
Impact on the Protocol: If the initialize function is called multiple times, it can lead to unintended state changes, though it may not necessarily compromise the entire contract's security. For example, ownership and address configurations can get overwritten.
Likelihood of Exploitation: Moderate. Although the risk exists, the impact is controlled. Initialization typically occurs in controlled settings and not in the wild.
Manual code review
To ensure the initialize function can only be called once, apply an initializer modifier. OpenZeppelin's Initializable contract provides a reliable implementation for this purpose.
Import Initializable from OpenZeppelin:
Modify the contract to inherit from Initializable:
Apply the initializer modifier to the initialize function:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.