Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

CS - BaseRouter - deposit stuck tokens #216

Closed 0xdcota closed 1 year ago

0xdcota commented 1 year ago

Where: https://github.com/Fujicracy/fuji-v2/blob/bffa427797ad8d6df63671868ee8823574e044ca/packages/protocol/src/abstracts/BaseRouter.sol#L85-L94

Description: The sweepToken function (BaseRouter.sol#L58) allows users with the HOUSE_KEEPER_ROLE role to transfer accidentally stuck ERC-20 tokens (due to the failed cross chain calls). A malicious user executing a Deposit action can deposit those assets on his behalf to the vault. Similarly, sweepETH function (BaseRouter.sol#L67) allows users with the HOUSE_KEEPER_ROLE role to transfer accidentally stuck Ether. A malicious user can withdraw a small sum of their assets using Withdraw action and all Ethers using a consecutive WithdrawETH action.

Recommendation: