The depositTheCrimeMoneyInATM function in The Laundrette contract requires users to approve the MoneyShelf contract before making a deposit. Due to the public nature of the mempool and the practice of some users or dApps to encourage maximum approval, there is a risk that a malicious user could exploit this approval to transfer all approved funds to their own account. Additionally, the function does not verify that the account parameter is the same as the msg.sender.
Function: depositTheCrimeMoneyInATM
Issue 1: Approval Exploitation
Users are required to approve the MoneyShelf contract for deposits.
Malicious users can exploit maximum approvals to transfer all approved funds.
Issue 2: Lack of Sender Verification
The function does not check that the account parameter matches the msg.sender, allowing unauthorized transfers.
Unauthorized Fund Transfers: Malicious users can transfer all approved funds from the victim's account, leading to significant financial loss.
Exploitation Risk: The public mempool and the practice of maximum approvals increase the risk of exploitation.
Godfather adds gang memebrs
Gang Member 1 gets 300e6 USDC from the GodFather
Gang Member 2 get nothing from the GodFather
Gang Member 1 approves 300e6 USDC to money shelf
Gang Member 2 calls laundrette.depositTheCrimeMoneyInATM(add1, add2, 300e6), entering Gang member 1 address as the account
and his own address as the to
address and the amount to be deposited.
Gang Member 2 gets 300e6 in crimeMoney
Gang Member 1 has 0 USDC in the account and 0 Crime Money
Manual Review
Implement Sender Verification: Modify the depositTheCrimeMoneyInATM function to ensure that the account parameter matches the msg.sender.
Limit Approval Amounts: Encourage users to approve only the necessary amount required for transactions, rather than maximum approvals.
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.