Anyone can trigger the withdrawTokensToL1() function even though the depositor do not want to withdraw yet
function withdrawTokensToL1(address to, uint256 amount, uint8 v, bytes32 r, bytes32 s) external
This is the external function that allow user to withdraw token to L1 if they already deposit same amount to L2 and get verified by the centralized off-chain actor
So for example A deposit 200 DAI to L2 and the event emitted
The off-chain actor will sign the message included:
and generate 3 piece of their signature: v,r,s
Those piece of signature v,r,s is public to anyone due to the params that withdrawTokensToL1 requires.
So this scenario can happen:
1, Anyone can get v,r,s because those variable are public
2, Anyone also know A deposited 200 DAI to L2 because the event in blockchain are public
3, They just need to add address depositor, amount and combine with v,r,s as params to pass to withdrawTokensToL1
so just by do that they can force withdraw to the user A even though user A do not want to withdraw yet.
This Vulnerability can lead to many scenario that any one not the depositor can trigger the withdraw behavior of other depositor every time.
Manual
Replace address to with msg.sender to prevent the caller of withdrawTokensToL1 is not the one who deposit to L2.
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.