How Does a Read-Only Attack Impact an On-Chain Lending Protocol?

In an on-chain lending protocol, a read-only reentrancy attack can impact the protocol by allowing an attacker to manipulate the valuation of collateral or debt. For example, an attacker calls a deposit function, which then calls an external token contract to check the balance.

If the attacker re-enters the deposit function to read the balance before the first call's state is updated, they can pass a check based on a stale, incorrect balance. This can lead to the protocol miscalculating the collateral ratio, potentially allowing an undercollateralized loan to be approved.

What Is a “Flash Loan” and How Does It Relate to Market Manipulation Risks on DEXs?
What Is a ‘Flash Loan Attack’ and How Does It Exploit DEX Protocols?
Why Is a Two-Step Approve and Transferfrom Process Often Cheaper in the Long Run for Frequent Interactions?
What Is the Defense against a Read-Only Reentrancy Attack?
How Does a Read-Only Reentrancy Attack Differ from These Two Types?
What Does a High Reading on the DVOL Index Typically Indicate?
What Is the Flash Loan Attack Vector in Liquidation?
Can a Sybil Attack Be Used to Manipulate the Price of a Derivative?

Glossar