Skip to main content

Why Are Fallback Functions Critical in a Reentrancy Scenario?

A fallback function is executed when a contract receives Ether without any specific function being called, or when a non-existent function is called. In a reentrancy attack, the malicious contract's fallback function is where the code to call back the original vulnerable contract is placed.

When the vulnerable contract sends Ether, the malicious fallback function is triggered, initiating the re-entry loop.

How Have Recent Versions of Solidity Changed the Behavior of Fallback Functions to Mitigate This Risk?
What Is the Difference between a Receive() and a Fallback() Function in Solidity?
Are Proof of Stake Networks Also Vulnerable to Majority Attacks?
What Is a “Reentrancy Attack” in Smart Contract Security?