Skip to main content

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.

Can a Block Builder Manipulate the Execution Price of a Derivatives Trade?
Why Is a Two-Step Approve and Transferfrom Process Often Cheaper in the Long Run for Frequent Interactions?
What Is a “Read-Only” Reentrancy Attack?
How Does Threshold Encryption Help in Preventing Transaction Reordering?