example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
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,
Claude Code
$ npx -y skills add omermaksutii/RugProof --skill dos-vectors --agent claude-code
Codex
$ npx skills add omermaksutii/RugProof --skill dos-vectors -a codex -y
Cursor
$ npx skills add omermaksutii/RugProof --skill dos-vectors -a cursor -y
Gemini CLI
$ npx skills add omermaksutii/RugProof --skill dos-vectors -a gemini-cli -y
GitHub Copilot
$ npx skills add omermaksutii/RugProof --skill dos-vectors -a github-copilot -y
OpenCode
$ npx skills add omermaksutii/RugProof --skill dos-vectors -a opencode -y
Windsurf
$ npx skills add omermaksutii/RugProof --skill dos-vectors -a windsurf -y
name: dos-vectors description: 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.
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).
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.
Smart wallets (Gnosis Safe, Argent) have fallback functions that need >2300 gas. Their users can't receive — effectively DoS for them.
Relayer pays gas; user provides bloated calldata to grief. Cap calldata length or charge per-byte.
Withdrawals from each strategy in a vault — if any strategy reverts, the entire withdraw fails. Use try/catch per strategy.
Auction ending exactly at `block.number == N` lets an attacker fill the block to prevent your bid. Use deadline windows + sniping protection (extend on late bid).
Unchecked subtraction in Solidity ≥0.8 reverts on underflow — function permanently broken if state lands in that range.
Anyone can `selfdestruct` to your contract and break a balance-equality check. Don't rely on `address(this).balance` equality. *(Note EIP-6780 changed selfdestruct semantics — see [[selfdestruct-eip6780]].)*
On rollups, anyone can force-include a tx via L1 — affects "exclusive sequencer" assumptions in auctions.
| Pattern | Severity | |---|---| | Unbounded loop attacker can grow → permanent function failure | **Critical** | | Push-payment to attacker-controlled `receive()` blocks core flow | **High** | | Per-strategy revert blocks entire vault withdraw | **High** | | Smart-wallet receivers can't get `.transfer` payouts | **Medium-High** | | Auction block-stuffing | **Medium** | | Balance-equality reliance | **High** | | Force-include L2 sequencer assumption | **Medium** | | Calldata gas-grief on relayer | **Medium** | | Bounded-but-large loop costing >block gas | **Medium** |
Rugproof your code before someone else does. 🌐 Live site: omermaksutii.github.io/RugProof 📦 Latest: v1.0.0 — 45 commands · 23 agents · 45 skills · 13 MCP servers · tested, offline-first, with rule packs, a benchmark, non-EVM coverage, and post-deploy
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect unsafe assumptions about Solady's gas-optimized ERC20/ERC2612 permit and DN404 metadata. Solady's ERC20 uses custom…
Detect front-runnable ownership initialization in Solady Ownable / OwnableRoles. Solady's `_initializeOwner` is a guarded…
Detect Solady SafeTransferLib calls that assume the token has code. SafeTransferLib.safeTransfer/safeTransferFrom/safeApprove…
Detect Uniswap V4 hooks that fail to settle currency deltas with the PoolManager. Every credit/debit a hook creates…
Detect Uniswap V4 hooks whose address-encoded permission flags don't match the callbacks the hook actually implements. In V4 the…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…