Skip to content

Arbitrary Low-Level Call

Description

An attacker may perform a call to an arbitrary address with controlled calldata, potentially leading to unauthorized actions or data manipulation.

Examples

Insecure Code

solidity
function vuln(address addr, bytes calldata data) public { addr.call(data); }

Secure Code

solidity
function secure(address addr, bytes calldata data) public { require(addr == authorizedAddress, 'Unauthorized address'); addr.call(data); }

Remediation

Validate and sanitize user input for the address and calldata to prevent unauthorized calls.

Rule Details

FieldValue
IDCODE-0656
CategoryInjection
SeverityHIGH
CWECWE-20
ConfidenceLOW
ImpactHIGH
LikelihoodHIGH
ExploitabilityMODERATE
Tagssmart contract, ethereum
OWASPN/A

References