skills/vulnerability-patterns/dos-revert/SKILL.md
Denial-of-service attacks through unexpected reverts in external calls
npx skillsauth add apegurus/solidity-argus dos-revertInstall 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.
// Push-payment: one reverting recipient blocks all payments
function payAll() external {
for (uint256 i = 0; i < recipients.length; i++) {
// If ANY recipient reverts (e.g., contract with no receive()),
// the entire function reverts — no one gets paid
require(payable(recipients[i]).send(amounts[i]), "transfer failed");
}
}
// Strict balance check broken by force-sent ETH
function withdraw() external {
// Attacker sends ETH via selfdestruct, breaking this check
require(address(this).balance == expectedBalance, "invariant");
_processWithdrawal();
}
// Division by zero
function distribute(uint256 totalShares) external {
// If totalShares == 0, this reverts and blocks the function
uint256 perShare = totalRewards / totalShares;
}
require or assert on external call results — one failure blocks all iterationsaddress(this).balance ==) — these can be broken by selfdestruct or coinbase rewards force-sending ETHrequire(success) after .send() or .call() inside loops — this turns a single recipient failure into a full DoS>= instead of ==>= instead of == for balance checks to tolerate force-sent ETHrequire(totalShares > 0)// Pull-payment pattern
mapping(address => uint256) public pendingWithdrawals;
function claimPayment() external {
uint256 amount = pendingWithdrawals[msg.sender];
require(amount > 0, "nothing to claim");
pendingWithdrawals[msg.sender] = 0;
(bool success,) = msg.sender.call{value: amount}("");
require(success);
}
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.