The depositTokensToL2 function in the L1BossBridge contract does not take into account any effect, which opens room for a reentrancy attack.
It's very important that contracts that interact with external contracts follow strictly the CEI principle. The depositTokensToL2 function as shown above fails to update the amount in the vault as well as the user(from) balance, which opens a door for an attacker to exploit the protocol.
Since the protocol contract does not actively track the increase in balance when assets are bridged out, and also does not follow the CEI which helps reduce the risk of reentrancy. An attacker can attack the contract by creating a contract whose falback would track for the bossBridge contract and call and also call the withdrawTokensToL1 function.
Loss of funds.
Manual Review
Implement CEI and ensure that the balances are updates before the safetransfer/bridge.
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.