The Laundrette::depositTheCrimeMoneyInATM
function allows users to deposit USDC
tokens and receive CrimeMoney
on behalf of any address, even if the user does not have permission to access the funds of that address.
The Laundrette::depositTheCrimeMoneyInATM
function calls the depositUSDC
function of the MoneyShelf
contract, which performs the following operations:
Calls the deposit
function of the Shelf
contract to update the account balance.
Transfers USDC tokens from the specified account to the MoneyShelf
contract using usdc.transferFrom(account, address(this), amount)
.
Mints CrimeMoney tokens for the specified to address.
The vulnerability lies in the fact that the usdc.transferFrom
function does not check if the caller (Laundrette
contract) has permission to transfer USDC tokens from the specified account. As long as the account has approved the MoneyShelf
contract to spend its USDC tokens, any user can call depositTheCrimeMoneyInATM
with that account and receive CrimeMoney tokens on behalf of any other address.
The impact is that it allows any user to deposit USDC tokens and receive CrimeMoney on behalf of any address, even if the user does not have permission to access the funds of that address. This lead to unauthorized transfers of funds and theft of USDC tokens and CrimeMoney.
Additionally, if the user receiving the CrimeMoney has the "gangmember" role, they can withdraw the USDC tokens deposited by the unauthorized user, effectively stealing the funds.
Aderyn, foundry
Use transfer
unstead of transferFrom
in MoneyShelf::depositUSDC
function
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.