Why Are Cross-Function Reentrancy Attacks Generally Harder to Detect?

Cross-function reentrancy attacks are harder to detect because the vulnerability is not contained within a single function. A security audit or a static analysis tool might examine a function and see that it correctly follows the Checks-Effects-Interactions pattern internally.

However, it might miss the fact that an external call in that function could lead to a callback into a different function that shares and manipulates the same state variables. Detecting this requires a holistic analysis of the entire contract's state and all possible execution paths, which is significantly more complex.

What Are the Security Benefits of Consolidating Multiple Token Types into a Single ERC-1155 Contract?
Can a Reentrancy Attack Be Performed without a Fallback Function?
How Can Reentrancy Attacks Be Prevented in Smart Contracts?
How Is a 51% Attack Easier on a Proof-of-Work (PoW) Coin than a Proof-of-Stake (PoS) Coin?
What Is a “Smart Contract Vulnerability” in the Context of Derivatives Settlement?
Do Reentrancy Guards Protect against Both Single-Function and Cross-Function Attacks?
Why Is the 2,300 Gas Limit Sometimes Considered a Design Flaw?
What Is a Flash Loan and How Can It Be Used to Amplify a Reentrancy Attack?

Glossar