Cream Finance Insufficient Validation Bug Fix Review
The Cream Finance liquidity mining rewards contract failed to check whether a user had participated in the program from the appropriate time, allowing a malicious user to claim rewards as if they had been participating from the beginning. This could drain approximately $100,000 in CREAM tokens from the discontinued contract.
immunefi.com
Published on immunefi.com
Azeem, Co-Founder of DeFi protocol Armor, became aware of a vulnerability in Cream Finance circulating in the wild and promptly reported it to Immunefi on June 13. The vulnerability was rated as “critical” because it allowed a malicious user to drain Cream’s liquidity mining rewards contract of approximately $100,000…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the contract did not verify that a user's participation start time matched the program's start, allowing anyone to claim rewards as if they had been participating from the beginning.
Impact
A malicious user could drain the discontinued liquidity mining rewards contract of approximately $100,000 in CREAM tokens, though the vulnerability had only been exploited for a minor amount and not in an automated fashion.
What the attacker needed
Access to Cream Finance interface; CRV tokens to deposit; multiple wallets
How it was found
- Deposit CRV in Cream Finance in new interface
- Navigate to Classic.cream.finance/rewards to earn an instant mint of 6% APY up front in CREAM tokens
- Swap CRV to ETH
- Send to new wallet
- Swap back to CRV
- Repeat exploit to obtain another instant 6% APY minted up front in CREAM rewards using the same CRV
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 write-up has not been written yet. The Original tab links to the source.
A rewards contract gives out tokens to people who deposit or borrow. It should only reward people who were in the program from the start, but it did not check that. So anyone could pretend to be an early participant and take tokens that were meant for others.
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.