skills/vulnerability-patterns/insufficient-gas-griefing/SKILL.md
- Contract relays or forwards calls on behalf of users (meta-transactions, multisig execution, relayer patterns)
npx skillsauth add apegurus/solidity-argus insufficient-gas-griefingInstall 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.
function execute(address target, bytes calldata data, uint256 gasLimit) external {
// Replay protection BEFORE sub-call — marks as executed regardless
require(!executed[nonce], "already executed");
executed[nonce] = true;
nonce++;
// Relayer can provide just enough gas for the outer tx to succeed
// but insufficient gas for the inner call — it silently fails
(bool success,) = target.call{gas: gasLimit}(data);
// success is false, but the nonce is already consumed
// The action is permanently censored
}
gasleft() validation before the sub-call (e.g., require(gasleft() >= requiredGas + overhead))execute functions where the executor controls gas forwarding.call{gas: X} is used where X comes from the caller — the caller can set it too lowrequire(success)) so the outer tx also reverts, preserving the noncerequire(gasleft() >= gasLimit + OVERHEAD)gasLimit * 64/63function execute(address target, bytes calldata data, uint256 gasLimit) external {
require(gasleft() >= gasLimit + 10000, "insufficient gas");
(bool success, bytes memory result) = target.call{gas: gasLimit}(data);
// Only mark as executed if sub-call succeeded
if (success) {
executed[nonce] = true;
nonce++;
}
}
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.