Incompatibility With Rebasing/Deflationary/Inflationary tokens
The strategy contracts do not account for tokens whose balances change during transfers or over time, such as rebasing, deflationary, or inflationary tokens. This could lead to a loss of funds because the contract's internal accounting may not match the actual token balance.
Submitted by defsec
The Strategy contracts do not appear to support rebasing/deflationary/inflationary tokens whose balance changes during transfers or over time. The necessary checks include at least verifying the amount of tokens transferred to contracts before and after the actual transfer to infer any fees/interest.
Proof of Concept
- https://github.com/code-423n4/2022-01-sandclock/blob/main/sandclock/contracts/strategy/BaseStrategy.sol#L239
- https://github.com/code-423n4/2022-01-sandclock/blob/main/sandclock/contracts/strategy/BaseStrategy.sol#L221
Recommended Mitigation Steps
- Make sure token vault accounts for any rebasing/inflation/deflation
- Add support in contracts for such tokens before accepting user-supplied tokens
- Consider to check before/after balance on the vault.
we did not intend to support those currencies in the first place
As with issues #55 and #164, this oversight can cause a loss of funds and therefor constitutes a medium risk. Simply saying you don’t support something does not mean that thing doesn’t exist or won’t cause a vulnerability in the future.
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
Likely the contract does not verify the actual token balance change after transfers, so it cannot detect fees or rebasing adjustments.
Impact
This oversight could cause a loss of funds, as the judge noted, even though the project said it did not intend to support such tokens.
What the attacker needed
Use of a rebasing or fee-on-transfer token
The fix
The contracts should check the vault balance before and after transfers and account for any rebasing, inflation, or deflation before accepting user-supplied tokens.
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 automatically change a wallet's balance: deflationary tokens take a fee on each transfer, so the receiver gets less than sent; rebasing tokens adjust balances periodically. If a contract assumes the amount sent equals the amount received, its records become wrong and funds can be lost.
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.