Fraxlend
An attacker could inflate the share price of an empty Fraxlend lending pool by making a series of deposits that round down to zero shares, causing a subsequent victim deposit to receive zero shares and lose their funds. The attacker could then redeem their single share to steal the victim's deposit.
mirror.xyz
Published on mirror.xyz
Fraxlend is a lending platform that provides lending markets between a pair of assets. Each pair is an isolated market which allows anyone to lend and borrow tokens.
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 vault's share calculation rounds down the number of shares minted, allowing an attacker to repeatedly deposit amounts that mint zero shares but increase total assets, thereby inflating the share price.
Impact
The entire deposit of a victim could be stolen, with past pools having initial deposits up to $100k USD.
What the attacker needed
Empty pool; attacker can frontrun victim deposit
How it was found
- Attacker deposits 1 wei of assets to an empty pair to mint 1 fToken
- Attacker deposits some collateral to borrow the 1 wei of assets, then repays it at least one block later, with an extra 1 wei of interest. This is all to achieve the required initial state of total.shares = 1 and total.amount = 2
- Now the attacker waits patiently, observing the mempool for a victim that wants to deposit into the pair
- The victim sends a transaction to deposit xxx assets into the pair
- The attacker frontruns the victim by performing n deposits to inflate the share value, such that the victim gets 0 shares and essentially donated the deposit to the attacker
- Now the attacker can redeem their single share, profiting the full deposit amount of the victim
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 lending pool where the value of one share can be manipulated. By making many small deposits that round down to zero shares, an attacker can make each share worth more. Then, when someone else deposits, they get zero shares and their money is effectively stolen by the attacker.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.