Yield Protocol Logic Error
A logic error in the burn function of Yield Protocol's strategy contract allowed an attacker to inflate the pool token balance by directly transferring tokens to the contract, then burn strategy shares to withdraw more LP tokens than deserved. This could drain base tokens from the pool, risking approximately $950k across Arbitrum and Ethereum.
immunefi.com
Published on immunefi.com
On April 28th, the whitehat Paludo0x responsibly disclosed a critical logic error vulnerability to Yield Protocol via Immunefi. The vulnerability involved a potential exploit that could allow an attacker to drain the base tokens from a pool by manipulating the token balance of a contract.
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
The burn function used the contract's live pool token balance (which can be inflated by direct transfers) instead of a cached internal accounting value to calculate the payout.
Impact
The vulnerability could allow an attacker to drain base tokens from the pool, with approximately $950k at risk across various pools on Arbitrum and Ethereum, but no user funds were lost due to timely remediation.
What the attacker needed
Access to the strategy contract; ability to transfer pool tokens directly
The fix
The burn function was fixed to use a cached pool balance (poolCached_) instead of the live balance to calculate the LP tokens to transfer.
How it was found
- Transfer pool tokens directly to the strategy contract to inflate its balance.
- Call mint to obtain strategy share tokens.
- Call burn to withdraw inflated amount of LP tokens.
- Call burn again to retrieve the LP tokens that were transferred.
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.
This is a bug in a smart contract that handles deposits and withdrawals. The contract calculated how many tokens to return based on its current token balance, which an attacker could artificially increase by sending tokens directly to the contract. Then, by burning shares, the attacker could withdraw more than they should, potentially stealing other users' funds.
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.