Malicious actors can watch when a user approve
bossbridge to spend his token and front-run depositTokensToL2 function which transfer the user funds to the address provided by the malicious users on layer1.
depositTokensToL2
gives users the opportunity to determine whose account they want to spend the fund from and whose address they want to witdraw it to on layer2. A user who has given bossbridge allowance but yet to withdraw to layer2 or gave boss bridge infinity allowance will give a malicious user opportunity to steal te useer funds by which he(malicious user) will specify the user address as the from
parameter in the depositTokensToL2
function to spend the user token and specify his(malicious user) address as the receiving address on layer2.
A mev bot or an attacker has the potential of front running all users who have given bossbridge allowance and steal all their funds.
manual review and foundry
Add the test above to L1TokenBridge.t.sol and run forge t --mt testAttackerCanstealApprovedTokensByOtherUsersAndDEposit -vvvvv
The team should make sure it is only the user who approved the his token to bossbridge is able to deposit it to the contract.
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.