/auditsentry:signature-replayfrom auditsentry
Detects signature replay vulnerabilities including missing nonces, cross-chain replay, EIP-712 domain mistakes, malleable signatures, and permit front-running in Solidity smart contracts.
Ships in auditsentry. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ecrecover and any signature verification pathpermit (EIP-2612, ERC-4494) implementationsbytes32 digest = keccak256(abi.encode(sender, amount)); // ← no nonce, infinitely replayable
require(ecrecover(digest, v, r, s) == sender);
EIP-712 domain MUST include chainId. Without it, signing on Ethereum replays on Optimism/Arbitrum/etc.
bytes32 domain = keccak256(abi.encode(EIP712_DOMAIN, name, version, /* no chainId */ , verifyingContract));
_DOMAIN_SEPARATOR cached without fork-detect (HIGH)DOMAIN_SEPARATOR = _hashDomain(block.chainid); // ← cached in constructor, breaks after fork
Re-compute when block.chainid differs.
ECDSA accepts both (r, s) and (r, n-s) for valid signatures. If you use the digest as a uniqueness key, attacker can flip s and replay. Enforce s ≤ secp256k1n/2 and v ∈ {27, 28}. Or use OpenZeppelin's ECDSA.tryRecover which already does this.
ecrecover returns address(0) on invalid sig — not reverted (HIGH)address signer = ecrecover(digest, v, r, s); // returns 0 on bad sig
require(roles[signer]); // ← if roles[address(0)] is ever true (default mapping behavior), it bypasses
Always require(signer != address(0)) after ecrecover, or use OZ ECDSA.
Missing address(this) / verifyingContract in the signed payload. Same admin sig usable on multiple deployments.
See [[mev-frontrunning]] §permit.
Off-chain signed orders where the maker can replay across fills if the order doesn't include salt + nonce + cancellation mechanism.
Mixing Permit2's SignatureTransfer (one-shot) vs AllowanceTransfer (persistent). Read the contract's docs carefully.
| Pattern | Severity |
|---|---|
| Missing nonce in signed payload | Critical |
| Missing chainId — cross-chain replay possible | Critical |
ecrecover without signer != address(0) check | High |
| Malleable signature accepted (no s-bound check) | High |
| Cached DOMAIN_SEPARATOR without fork-aware re-compute | High |
Signed payload omits verifyingContract | High |
| Order salt missing, no cancellation mechanism | High |
| Off-by-one chainId for L2 chains (e.g. Polygon = 137 not 1) | High |
| Permit gas-grief on revert reverts in batch | Medium |
EIP712 base + ECDSA.recover — handles s-bound, malleability, zero-address.chainId, verifyingContract, nonce, deadline, plus any operation-specific fields.DOMAIN_SEPARATOR lazily when block.chainid != cached_chainid.isValidSignature(bytes32, bytes) returning the magic value.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub iktok90-design/ai-smart-contract-auditor --plugin auditsentry45 skills in this plugin
/access-controlDetect missing or incorrect access control — missing modifiers, wrong role checks, privileged function exposure, public initializers, and role-escalation paths. Activate on any function that mutates state, transfers funds, mints tokens, sets admin parameters, upgrades implementations, or pauses/unpauses./approval-issuesDetect ERC-20 approval pitfalls — approve race (front-run), missing safeApprove, infinite approvals, approval-without-revoke, Permit2 misuse, max-approval to untrusted contracts. Activate on `approve`, `safeApprove`, `permit`, `forceApprove`, `Permit2`, `IERC20.allowance`./caching-and-incrementalAlways-on meta-skill — cache audit results per file by content hash so unchanged files aren't re-analyzed on subsequent runs. Activate on every /audit, /quick-scan, /audit-changes invocation./centralization-riskDetect centralization and trust-assumption risks — admin powers, single-key risk, missing timelocks, upgrade authority, treasury keys, pause permanence, blacklisting authority, oracle authority. Activate on `onlyOwner`, `onlyRole`, `AccessControl`, upgrade authorizations, pause/unpause functions, mint/burn caps, treasury/fee setters./confidence-scoringAlways-on meta-skill — for every finding produced, attach a confidence level (HIGH/MEDIUM/LOW) and a reasoning trace. Activate on every /audit, /audit-deep, /audit-changes, /audit-live, /quick-scan invocation./cosmwasmDetect bug classes specific to CosmWasm (Rust) contracts — missing info.sender authorization in execute handlers, unbounded map iteration → gas/DoS, reply/submessage reply_id confusion, migrate admin backdoors, addr_validate vs raw string addresses, unchecked info.funds, Uint128 overflow, query reentrancy, and migration/version state. Activate on any `.rs` file with `use cosmwasm_std`, `#[entry_point]`, `ExecuteMsg`, `InstantiateMsg`, `QueryMsg`, `cw_storage_plus`, or `DepsMut`.Other plugins' skills for the same job