Open hats-bug-reporter[bot] opened 4 months ago
Asset managers are receiving the fees, so there is no motivation for them to avoid paying the fees.
As written, the fees are for Asset Manager AND Protocol (velvet), the motivation is to skip paying fees for Protocol. @langnavina97
Asset manager doesn't pay fee to protocol, instead protocol will receive a minted share portion. But I agree there will be some potential loss of share for protocol when asset manager did this, but this is just a low issue as it only impact asset manager and the potential loss is small
Github username: -- Twitter username: -- Submission hash (on-chain): 0x8e9a311a50998bc8e7adecc06c1d5cb4536ab172f3cea7f4e81ce516d12d85f5 Severity: medium
Description: Description
In Velvet, fee can be charged on Deposit and Withdrawal, via
_chargeFees
call. This fee being charged is for protocol and management fees. Protocol fee is for Velvet, and management fee is for Asset manager.If we look at following
_chargeFees
implementation, the fee is exempted on internal transfer, which the address areassetManagerTreasury
orvelvetTreasury
. Meaning, any Deposit or Withdrawal related with this address are not going to be charged.Asset manager treasury can't deposit due to
_beforeDepositCheck
, we may think this intended check which exist to prevent asset manager to abuseassetManagerTreasury
as a way to skip fees.But that's not effective, as Asset manager can easily update this asset manager treasury address.
They can simply change the address, to escape from paying fee on withdrawal, and may revert back if needed.
This fee exemption is not going to be detected by public user, thus the asset manager didn't do any malicious activity to public / users. But, here protocol is being tricked, they are not having the fees they supposed to have.
Attack Scenario
Asset manager (example using an address 0xBEEF) buy
portfolio
token, when when they want to withdraw, they temporarily set the 0xBEEF asassetManagerTreasury
, then revert back if necessary. Here asset manager being exempt from withdrawal fees (especially the protocol fee). Protocol lose potential fee from this malicious activity.Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)
Recommendation
There might be some other way, but one way is, instead of sending
portfolio
token as fee distribution toassetManagerTreasury
, why not swap it to a token (eq. USDC) first, then transfer. Then,assetManagerTreasury
should be prevented to do any transfer ofportfolio
token by adding restrictionfrom
&to
in_beforeTokenTransfer