example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect ERC-4337 account-abstraction bugs — validateUserOp storage-rule violations, paymaster postOp DoS, session-key scope bypasses, signature aggregation issues, EIP-7702 delegation risks. Activate on `validateUserOp`, `validatePaymasterUserOp`, `postOp`, `UserOperation`,
Claude Code
$ npx -y skills add omermaksutii/RugProof --skill erc4337-account-abstraction --agent claude-code
Codex
$ npx skills add omermaksutii/RugProof --skill erc4337-account-abstraction -a codex -y
Cursor
$ npx skills add omermaksutii/RugProof --skill erc4337-account-abstraction -a cursor -y
Gemini CLI
$ npx skills add omermaksutii/RugProof --skill erc4337-account-abstraction -a gemini-cli -y
GitHub Copilot
$ npx skills add omermaksutii/RugProof --skill erc4337-account-abstraction -a github-copilot -y
OpenCode
$ npx skills add omermaksutii/RugProof --skill erc4337-account-abstraction -a opencode -y
Windsurf
$ npx skills add omermaksutii/RugProof --skill erc4337-account-abstraction -a windsurf -y
name: erc4337-account-abstraction description: Detect ERC-4337 account-abstraction bugs — validateUserOp storage-rule violations, paymaster postOp DoS, session-key scope bypasses, signature aggregation issues, EIP-7702 delegation risks. Activate on `validateUserOp`, `validatePaymasterUserOp`, `postOp`, `UserOperation`, `EntryPoint`, `IAccount`, `IPaymaster`, session-key modules, ERC-7579 modules, EIP-7702 authorization payloads.
ERC-4337 §6 forbids `SLOAD` on storage slots outside the wallet's own contract during validation. Bundlers reject non-compliant UserOps. Beyond compliance, accessing external state during validate is a *banner attack surface* (e.g. reading from an attacker-controlled contract).
function validateUserOp(...) external returns (uint256) {
uint256 x = IExternal(0xabc).read(); // ← violates storage rules + leaks attack surface
...
}function validateUserOp(...) external returns (uint256) {
// ← anyone can call directly, bypass bundler entirely
}function postOp(PostOpMode mode, bytes calldata ctx, uint256 actualGasCost) external {
require(...); // ← if this reverts in postOp, bundler is griefed; reputation system penalizes the paymaster
}`postOp` should be revert-free. Use try/catch or never revert.
Token-paying paymaster converts ERC20 → ETH at validate time. If oracle is spot AMM, sandwichable. See [[oracle-manipulation]].
Sponsorship sig replayable. See [[signature-replay]].
Session keys grant limited authority (allowed selectors, allowed targets, time bounds). Bypass paths:
EIP-7702 delegations replayable across chains if `chainId == 0` or missing chainId binding.
User signs an authorization to a contract address. If that contract is upgradeable / attacker-controlled, the EOA's nonce-aware delegated-call grants full control.
BLS-aggregated UserOps with `aggregator` field — if aggregator's verifier doesn't include chainId, cross-chain replay possible.
ERC-4337 uses 192-bit "nonce-key" for parallel UserOps. If multiple session keys / dapps share key 0, they serialize unnecessarily. Worse: if key encoding collides with another semantic, a stuck UserOp can DoS.
Meta-tx with permit can collide on nonces with regular UserOp.
ERC-7579 / ERC-6900 module install paths sometimes lack `onlyEntryPointOrOwner`. Install path → arbitrary module → arbitrary execution.
| Pattern | Severity | |---|---| | `validateUserOp` callable by non-EntryPoint | **Critical** | | Module install lacks auth check | **Critical** | | EIP-7702 missing chainId in authorization | **Critical** | | EIP-7702 delegation to mutable contract | **Critical** | | Paymaster postOp can revert | **High** | | Session-key scope bypass via multicall/fallback | **High** | | Storage-rule violation in validate | **High** | | Token-paymaster spot-oracle dependency | **High** | | Sponsorship-paymaster sig without nonce/deadline | **High** | | Aggregated sig missing chainId | **High** | | Nonce-key naming collision | **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…