Can a Contract’s Fallback Function Intentionally Consume More than 2,300 Gas?

Yes, a contract's fallback function can be programmed to intentionally consume more than 2,300 gas by including gas-intensive operations, such as writing to storage or executing a loop. If such a contract receives Ether via transfer or send , the transaction will revert due to an out-of-gas error in the fallback function.

This is a potential denial-of-service vector for legitimate transfers.

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?
Why Is the 2,300 Gas Limit Sometimes Considered a Design Flaw?
Why Do Storage Operations (SSTORE) Cost More Gas than Simple Calculations?
What Is a Denial-of-Service (DoS) Attack Related to Fallback Functions?
Can a Front-Runner Deliberately Cause a Transaction to Revert Using Slippage?
What Is the Concept of ‘Gas Optimization’ in Smart Contract Development?
Does the Send Function Have the Same Gas Limitations as Transfer ?

Glossar