Skip to main content

Delegatecall Exploit

Definition

A delegatecall exploit arises in smart contracts when a contract uses the delegatecall function to execute code from another contract, but fails to properly manage the context of the execution. The delegatecall instruction executes code from a target address within the calling contract’s storage, allowing the called contract to modify the caller’s state variables. If the called contract is malicious or contains vulnerabilities, it can lead to unauthorized changes to the calling contract’s data or asset transfers. This type of attack highlights the critical need for meticulous security auditing in composable smart contract architectures.