Summary
The smart contract allows users to withdraw any amount of tokens to L1 without checking the deposit amount record.
Vulnerability Details
The withdrawTokensToL1 function in the smart contract does not include any validation or checking of the deposit amount before allowing the withdrawal.
This allows any user to withdraw tokens to L1 without having a corresponding deposit amount.
Here is the test example code, user deposit amount is depositAmount but withdraw 2*depositAmount tokens.
Impact
Users can exploit the contract by withdrawing more tokens than they have actually deposited
Recommendations
Implement a deposit tracking mechanism: Maintain a record of the deposited tokens and their corresponding amounts to ensure that only the deposited amount can be withdrawn.
Add validation checks: Before allowing a withdrawal, verify that the user's withdrawal amount does not exceed their deposited amount.
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.