skills/vulnerability-patterns/delegatecall-untrusted-callee/SKILL.md
Contract uses delegatecall with potentially untrusted callee
npx skillsauth add apegurus/solidity-argus delegatecall-untrusted-calleeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
delegatecalldelegatecall is derived from user input, function parameters, or a mutable state variable settable by non-admin users// User-controlled delegatecall target
function forward(address callee, bytes calldata data) external {
// Attacker supplies callee = malicious contract
// Malicious contract overwrites storage (e.g., slot 0 = owner)
(bool success,) = callee.delegatecall(data);
require(success);
}
// Proxy with unprotected implementation setter
function setImplementation(address _impl) external {
// Missing: require(msg.sender == admin)
implementation = _impl;
}
delegatecall invocations in the codebaseupgradeTo / setImplementation functions have proper access controldelegatecalldelegatecall target is hardcoded or immutable (e.g., address immutable IMPL)delegatecall targets to trusted, immutable, or admin-only-settable addressesdelegatecall with a user-supplied target address// Safe: immutable implementation
address immutable implementation;
constructor(address _impl) {
implementation = _impl;
}
fallback() external payable {
(bool s,) = implementation.delegatecall(msg.data);
require(s);
}
testing
Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
tools
Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
testing
Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
testing
Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.