Fee-on-Transfer tokens cause problems in multiple places
The vault and controller contracts do not account for tokens that charge a fee on transfer, so the vault mints more shares than the assets received and later attempts to send the full balance fail. This can leave the last users unable to withdraw and prevent the end of an epoch from being triggered.
Submitted by Lambda, also found by csanuragjain, Deivitto, R2, and Rolezn
Impact & Proof Of Concept
Certain tokens (e.g., STA or PAXG) charge a fee for transfers and others (e.g., USDT or USDC) may start doing so in the future. This is not correctly handled in multiple places and would lead to a loss of funds:
SemiFungibleVault.deposit: Here, less tokens are transferred to the vault than the amount of shares that is minted to the user. This is an accounting mistake that will ultimately lead to the situation where the last user(s) cannot withdraw anymore, because there are no more assets left.Controller.triggerDepeg&Controller.triggerEndEpoch:sendTokenstries to send the whole asset balance to the other contract, which will fail when less tokens are available at this point (because the previous accounting was done without incorporating fees). This will mean that the end can never be triggered and all assets are lost.
Recommended Mitigation Steps
When fee-on-transfer tokens should be supported, you need to check the actual balance differences. If they are not supported, this should be clearly documented.
MiguelBits (Y2K Finance) acknowledged
Valid because SemiFungibleVault may not be applied to WETH only (unlike Vault), but generic tokens. Furthermore, if there is an intention to make semi fungible vaults an EIP standard, then one may have to consider catering to FoT tokens as well, unless explicitly stated otherwise.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The contracts assume the full transfer amount is received and do not check the actual balance difference, so fee-on-transfer tokens break the accounting.
Impact
Users may lose funds because the last withdrawals cannot be fulfilled and the end of an epoch may never be triggered, leaving assets stuck.
What the attacker needed
Fee-on-transfer token used; vault or controller in use
The fix
The contracts should check the actual balance difference after transfers if fee-on-transfer tokens are to be supported, or clearly document that such tokens are not supported.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Some tokens take a small cut when they are moved between wallets. The code here assumes the full amount arrives, so it records more money than it actually holds. Later withdrawals or transfers can fail because the real balance is lower than expected.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.