/auditsentry:signature-malleabilityfrom auditsentry
Detects ECDSA signature malleability and ecrecover pitfalls in Solidity: missing low-s (EIP-2) enforcement, unconstrained v, unchecked address(0), missing EIP-712 domain separators, EIP-2098 confusion, and signature reuse.
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.
Trigger on any of:
ecrecover(hash, v, r, s) calls (not via OpenZeppelin ECDSA.recover)(r, s, v) decoding from a bytes signature with assemblyusedSig[sig] = true)address signer = ecrecover(hash, v, r, s); // no s-range check
require(signer == expected);
usedSignature[keccak256(abi.encode(r,s,v))] = true; // ← dedup keyed on sig bytes
Signal: for any valid (r,s,v) the "flipped" signature (r, n - s, v ^ 1) recovers the same signer (the classic Bitcoin/Ethereum transaction-malleability class). If the signature itself is the replay key, an attacker submits the twin and bypasses dedup. Enforce s <= secp256k1n/2 (EIP-2).
address signer = ecrecover(hash, v, r, s);
require(signer == owner); // if owner could ever be address(0)... or no check at all
Signal: malformed inputs make ecrecover return address(0). Any code path where the compared-against value can be address(0) (uninitialized mapping slot, default) authenticates an attacker with garbage. Always require(signer != address(0)).
Accepting arbitrary v (not 27/28) or trusting a caller-supplied v for EIP-2098 compact sigs, mixing the 64-byte and 65-byte formats. EIP-2098 packs yParity into the high bit of s; decoding it as a raw 65-byte sig corrupts recovery.
bytes32 digest = keccak256(abi.encode(ORDER_TYPEHASH, maker, amount, nonce));
Signal: no EIP-712 domain separator binding chainId and verifyingContract. A signature is replayable on another chain (post-fork) or a sibling deployment. Build the digest with _hashTypedDataV4 (\x19\x01 + domainSeparator + structHash) and recompute the domain separator if block.chainid changes.
Same digest accepted twice because there's no per-signer nonce or no marking of consumed digests — meta-tx and claim flows drain repeatedly.
| Pattern | Severity | Notes |
|---|---|---|
| Malleable sig used as replay/dedup key | High | Twin sig bypasses guard |
| ecrecover==address(0) authenticates attacker | High | Auth bypass |
| Missing EIP-712 domain → cross-chain replay | High | Signature reuse across deployments |
| No nonce → straight replay | High | Repeated execution |
| Unconstrained v / EIP-2098 confusion | Medium | Format-dependent |
| Low-s missing but sig never used as a key | Low | Defense-in-depth |
ECDSA.recover — it enforces s <= secp256k1n/2, rejects bad v, and reverts on address(0) (it also handles EIP-2098).EIP712 base + _hashTypedDataV4), including chainId and verifyingContract; recompute the domain separator on chainid change.(signer, nonce) not (r,s,v).require(signer != address(0)) even when using libraries, for any hand-rolled path.SignatureChecker when signers may be ERC-1271 contract wallets.ECDSA/SignatureChecker with EIP-712 and nonces is safe — don't re-flag the underlying ecrecover.isValidSignatureWhat SKILL.md sets; muted values are Claude Code's defaults
45 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`.npx claudepluginhub iktok90-design/ai-smart-contract-auditor --plugin auditsentryOther plugins' skills for the same job