Incorrect internal balance bookkeeping
The smart contract system tracks user deposits using internal bookkeeping without verifying that the actual token balance increased by the expected amount. An attacker can use deflationary or fee-charging tokens to deposit less than the recorded amount and still receive full rewards and yield.
Submitted by walker, also found by cmichel and shw
The sherlock smart contract system uses internal bookkeeping of arbitrary ERC20 token balances. It doesn’t assert that the ERC20 doesn’t implement some non-standard behavior. For example, deflationary tokens, or tokens with a transfer fee, will result in incorrect internal balances. In summary, an attacker can perform stake and deposit actions without actually depositing the amount that sherlock assumes. As a result, an attacker is unduly rewarded balance and yield.
Balancer had a similar vulnerability in their system https://blog.1inch.io/balancer-hack-2020-a8f7131c980e.
An example location where such internal bookkeeping happens can be found here
Mitigating the issue is possible by requiring the amount to be added to the contracts’ balance. Alternatively, it’s possible to update the pool based on actual balance changes.
Evert0x (Sherlock) acknowledged and disagreed with severity:
2 med-risk, as extensive research will be done before adding certain tokens. This finding could even be noted a 0 non-critical if only ‘standard’ ERC20s are being used.
med-risk because certain popular tokens are up-gradable and could potentially implement non-standard behavior
since there will be a curation process, I agree with sponsor, this is medium risk
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 contract assumes all ERC20 tokens transfer the exact amount specified, without verifying the actual balance change, so fee-on-transfer or deflationary tokens cause the internal accounting to overstate deposits.
Impact
An attacker could receive inflated internal balances and earn undue yield, though the sponsor notes that only non-standard tokens are affected and a token curation process reduces the risk.
What the attacker needed
Non-standard ERC20 token (fee or deflationary); token must be accepted by the protocol
The fix
The issue should be fixed by requiring that the contract's actual token balance increases by the deposited amount, or by updating the pool based on real balance changes.
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 digital tokens take a small fee when transferred, so the receiver gets less than the sender sent. This contract records the full amount as deposited without checking the real balance, letting someone get credit for more than they actually put in. That means they earn rewards on money they never deposited.
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.