Venus Protocol: THE Market Donation Attack
The Venus THE market computed its cash balance by reading the vToken contract's raw ERC-20 balance, so tokens sent directly to the contract inflated the exchange rate without minting new vTokens. An attacker used this to borrow far more than their collateral was worth, extracting roughly $3.7 million and leaving about $2.18 million in bad debt.
medium.com
Published on medium.com
On March 15, 2026, the Venus Protocol THE (Thena) market on BNB Chain was drained of approximately $3.7 million through a donation attack, a well-documented vulnerability class in Compound-forked lending protocols. The attacker exploited a single root-cause flaw in the getCashPrior() function, which reads the…
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 getCashPrior() function read the contract's live ERC-20 balance instead of an internal accounting variable, so unsolicited transfers were counted as protocol cash.
Impact
The attacker extracted approximately $3.7 million in other assets and left about $2.18 million in unrecoverable bad debt, though a governance freeze of attacker funds meant the attacker ended with a net loss.
What the attacker needed
Funds to donate as collateral; a listed market using balanceOf for cash; thin liquidity in the collateral asset
The fix
The getCashPrior() function was patched to return an internal cash state variable that only changes through mint, redeem, borrow, repay and liquidate.
How it was found
- Supply tokens normally through mint() to receive vTokens and establish a position
- Transfer THE tokens directly to the vTHE contract address, bypassing mint()
- The exchange rate inflates and the Comptroller grants inflated borrow capacity
- Borrow assets, swap them for more THE on DEXs and donate again to compound the loop
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 lending pool tracks how much each depositor owns by comparing the pool's total assets with the number of pool tokens issued. Here the pool worked out its assets by simply asking the token contract 'how many tokens do you hold?', so anyone could send tokens straight to the pool and make every existing pool token look more valuable. The attacker did that, then used the inflated value as collateral to borrow other assets they never repaid.
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.