Deposit call can be frontrun as the owner of the tokens is not checked
The function transfer an amount of tokens from an address passed as parameter, but it doesn't check that the caller of the function is actually the owner of the tokens. This opens up the following attack vector:
- User own 100 tokens
- User approves the `BossBridge` so he can call `Deposit`
- User calls `Deposit(Alice, AliceOnL2, 100)`
- Attacker is watching the mempool for any `Deposit()` calls.
- Attacker submits a transaction with the following params: `Deposit(Alice, AttackerOnL2, 100)` and pays a higher gas fee
- Attacker transaction is mined before Alice's and the tokens will be minted on L2 to the AttackerOnL2 address using Alice tokens
High
Manual
Transfer the tokens from the msg.sender
PoC:
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.