What Is a “Read-Only” Reentrancy Attack?
A read-only reentrancy attack is a more subtle form where the attacker does not steal funds but instead exploits a contract's reliance on the victim contract's state during a transaction. The attacker calls the victim contract, which then calls an external contract.
This external contract calls back to the victim, but only to read a state variable (like a balance) that has not yet been updated by the current transaction. This allows the attacker to make decisions based on stale, incorrect data, potentially leading to unfair liquidations or incorrect price calculations.