Overview
Malicious external calls are contract interactions that can be exploited to steal funds, manipulate state, or enable other attacks.Types of Malicious External Calls
Arbitrary External Call
Allows calling any contract with any data, enabling theft.token.transfer(attacker, balance) on any token.
Unprotected Delegatecall
Delegatecall executes external code in the context of the calling contract.Callback to Untrusted Contract
Calling user-provided addresses without validation.Approve and Call Patterns
Combining approvals with external calls.Safe Patterns
Whitelist External Calls
Validate Callback Addresses
Limited Approvals
Detection Tags
| Tag | Severity | Description |
|---|---|---|
external_call | Medium | Arbitrary external call detected |
dangerous_delegatecall | High | Unprotected delegatecall |
untrusted_callback | Medium | Callback to user-provided address |
unlimited_approval | Medium | Infinite token approval |
API Response Example
Prevention Checklist
- Whitelist allowed external call targets
- Validate all callback addresses
- Use exact approval amounts, not unlimited
- Avoid delegatecall to user-provided addresses
- Implement reentrancy guards around external calls
