The withdrawMoney
function allows withdrawing USDC from the moneyShelf
contract where the source account and the recipient address can differ. This design flaw can lead to accidentally sending the USDC
tokens to the wrong recipient.
The function withdrawMoney
calls moneyShelf.withdrawUSDC
, which takes three parameters: account
, to
, and amount
. The issue arises because the withdrawMoney
function allows the account
parameter (the source from which to withdraw the funds) to be different from the to
parameter (the recipient of the funds). If an incorrect to
address is provided, the user may end up losing all of their tokens.
Paste the following code into the Laundrette.t.sol
file and then run the script:
The vulnerability introduces the risk of misallocating tokens, potentially resulting in financial loss for users. If an incorrect recipient address (to
parameter) is provided when calling the withdrawMoney
function, the tokens may be sent to the wrong destination. This can lead to confusion, loss of funds, and potential disputes among users.
forge test
Remove the address to
argument from the withdrawMoney
function, because the only person who should be able to receive USDC should be the sender of the transaction (which also needs to be a gangmember) or the godFather
.
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.