Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Any user can withdraw on behalf of the Godfather in the `MoneyVault` module

Summary

Any user can make the godfather to withdraw USDC from the MoneyVault, because there is not an access control to the withdrawUSDC function.

Vulnerability Details

Missing modifier is Godfather, for the withdrawUSDC function.

function withdrawUSDC(address account, address to, uint256 amount) external {
require(to == kernel.executor(), "MoneyVault: only GodFather can receive USDC");
withdraw(account, amount);
crimeMoney.burn(account, amount);
usdc.transfer(to, amount);
}
According to the documentation, should be:
```MoneyVault
In case of any issue (on-chain or off-chain), MoneyShelf is updated to this contract to protect the money from the justice system or any other gang. Only the GodFather can withdraw and no one can deposit in this contract.

Impact

The Godfather lose the control over when to withdraw USDC from MoneyVault.

Tools Used

Manual review

Recommendations

Make this change to the code:

- function withdrawUSDC(address account, address to, uint256 amount) external {
+ require (tx.origin == kernel.executor(), “MoneyVault: you are not Godfather”)
require(to == kernel.executor(), "MoneyVault: only GodFather can receive USDC");
withdraw(account, amount);
crimeMoney.burn(account, amount);
usdc.transfer(to, amount);
}
Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.