Description: The Laundrette::depositTheCrimeMoneyInATM
function takes two address parameters as input, an account
which is the address that we will get the tokens from
and an address to
which is the address on behalf of which tokens are deposited into the protocol. The Shelf::deposit
function will credit the amount of tokens deposited on behalf of address to
when someone calls the depositTheCrimeMoneyInATM
function.
The problem arises from the fact that if user A approves the protocol to spend 1000 USDC, user B can call the Laundrette::depositTheCrimeMoneyInATM
function with account == user A's address
, to == user B's address
, amount == 1000 USDC
.
Impact: User B is able to steal the funds of user A, by depositing user A's tokens into the protocol, but getting the amount credited to his address instead.
Proof of Concepts: Place the following test into the Laundrette.t.sol
file.
Test output
Recommended mitigation: Add checks to enforce that the address depositing the tokens is the actual sender of the transaction.
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.