dos-vectors

Solid

Detect denial-of-service vectors — unbounded loops, gas griefing, push-payment chokepoints, block-stuffing exposure, revert-on-receive blocking. Activate on loops over user-controlled arrays, batch withdrawals, push-style payouts, queues, auctions with "highest-bidder" refunds, large airdrops.

AI & Automation 38 stars 5 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
53
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# DoS vector detection ## When this applies - Loops iterating over user-supplied or unbounded arrays - Push-style payment patterns (contract pushes value to N recipients) - Auctions that refund the previous highest bidder via direct transfer - Mass `claim()` / `distribute()` functions - Queues / stacks of withdrawals - Functions whose gas cost scales with `n` users / `n` tokens - L2 forced inclusion mechanics ## Detection patterns ### Unbounded loop over user-controlled array (CRITICAL-HIGH) ```solidity function distribute() external { for (uint i; i < holders.length; ++i) { payable(holders[i]).transfer(rewards[i]); // ← gas grows; eventually un-callable } } ``` Worse if attacker can grow `holders` (e.g. anyone can register). ### Push-payment with revert-on-receive (HIGH) ```solidity function refundPreviousBidder() internal { payable(highBidder).transfer(highBid); // ← attacker bids from contract that reverts on receive → freezes auction } ``` Use pull-payments: store credits, let users withdraw. ### `.transfer` (2300 gas) blocks smart-wallet receivers (MEDIUM-HIGH) Smart wallets (Gnosis Safe, Argent) have fallback functions that need >2300 gas. Their users can't receive — effectively DoS for them. ### Gas griefing via large calldata (HIGH on relayers) Relayer pays gas; user provides bloated calldata to grief. Cap calldata length or charge per-byte. ### `external` reentrant fee-loop DoS (HIGH) Withdrawals from each strategy in a vault — if any ...

Details

Author
iktok90-design
Repository
iktok90-design/ai-smart-contract-auditor
Created
1 weeks ago
Last Updated
2 days ago
Language
JavaScript
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category