The depositTheCrimeMoneyInATM
function allows depositing USDC into the moneyShelf
contract where the source account and the recipient address can be different. This design flaw can lead to unauthorized fund transfers if an attacker exploits the function.
The function depositTheCrimeMoneyInATM
calls moneyShelf.depositUSDC
, which takes three parameters: account, to, and amount
. The problem arises because the depositUSDC function allows the account parameter (the source of the funds) to be different from the to parameter (the recipient of the funds). If the account (victim) has granted approval for a large amount of funds, any caller can use this function to transfer funds from the account
to any to
address without the account's direct consent. The victim ends up to pay for the transfer and the attacker actually receives the CrimeMoney
token + his USDC account balance in the moneyShelf contract gets updated.
Paste the following code into the Laundrette.t.sol
contract and then run the command:
This vulnerability can lead to unauthorized fund transfers where an attacker can drain funds from a victim's account (gangMember) to benefit another user (testAccount). This undermines the integrity of the fund management system and can result in significant financial loss for users. In order to withdraw the CrimeMoney
back to USDC the attacker needs the "gangMember" role.
forge test
Restrict Access: Ensure that only the account owner can initiate the transfer of their funds.
Verify Caller: Add checks to verify that msg.sender is either the account itself.
Remove the to
address because this should match with the account
anyways.
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.