signature-replay
Skill36 starsChanged 5 months agoMITView on GitHub
Detect signature-replay, EIP-712 / EIP-2612 mistakes, malleable signatures, cross-chain replay, missing nonces. Activate on `ecrecover`, `permit`, meta-transactions, signed orders, signed approvals, EIP-712 domain construction, gasless transaction relayers.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- conjure-3301/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository44 other files it gives its agents.
- access-controlSkill
- approval-issuesSkill
- caching-and-incrementalSkill
- centralization-riskSkill
- confidence-scoringSkill
- cosmwasmSkill
- cross-chain-messagingSkill
- cross-contract-stateSkill
- delegatecall-risksSkill
- diamond-eip2535Skill
- dos-vectorsSkill
- erc1271-contract-signaturesSkill
- erc4337-account-abstractionSkill
- erc4626-inflationSkill
- false-positive-feedback-loopSkill
- fee-on-transferSkill
- flash-loan-attacksSkill
- initializationSkill
- inline-assemblySkill
- integer-issuesSkill
- intents-erc7683Skill
- known-good-comparisonSkill
- liquidation-cascadeSkill
- mev-frontrunningSkill
- mev-pbsSkill
- multi-pass-self-critiqueSkill
- oracle-manipulationSkill
- oracle-redundancySkill
- permit2-patternsSkill
- pragma-and-addressesSkill
- progress-and-streamingSkill
- reentrancySkill
- restaking-eigenlayerSkill
- selfdestruct-eip6780Skill
- signature-malleabilitySkill
- solana-anchorSkill
- storage-layoutSkill
- stylus-rustSkill
- token-compatibilitySkill
- tx-context-misuseSkill
- unchecked-callsSkill
- ve-lock-governanceSkill
- vyper-specificSkill
- zk-verifier-bugsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Always require(signer != address(0)) after ecrecover, or use OZ ECDSA.
- Very specific: line 75
Use OZ EIP712 base + ECDSA.recover — handles s-bound, malleability, zero-address.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Signature replay & EIP-712 detection
When this applies
ecrecoverand any signature verification pathpermit(EIP-2612, ERC-4494) implementations- Meta-tx / gasless flows (ERC-2771, EIP-3074 / EIP-7702 wrapping)
- Signed off-chain orders (0x, Seaport, custom)
- Signed governance votes
- Validator-set / bridge signature aggregation (see [[bridge-specialist]])
Detection patterns
Missing nonce (CRITICAL)
bytes32 digest = keccak256(abi.encode(sender, amount)); // ← no nonce, infinitely replayable
require(ecrecover(digest, v, r, s) == sender);Missing chainId in domain (CRITICAL — cross-chain replay)
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));Hardcoded chainId / _DOMAIN_SEPARATOR cached without fork-detect (HIGH)
DOMAIN_SEPARATOR = _hashDomain(block.chainid); // ← cached in constructor, breaks after forkRe-compute when block.chainid differs.
Signature malleability (HIGH)
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 bypassesAlways require(signer != address(0)) after ecrecover, or use OZ ECDSA.
Replay across contracts (HIGH)
Missing address(this) / verifyingContract in the signed payload. Same admin sig usable on multiple deployments.
Front-running of permit (MEDIUM)
See [[mev-frontrunning]] §permit.
Approval-front-run via signed message (HIGH)
Off-chain signed orders where the maker can replay across fills if the order doesn't include salt + nonce + cancellation mechanism.
Permit2 confusion (HIGH)
Mixing Permit2's SignatureTransfer (one-shot) vs AllowanceTransfer (persistent). Read the contract's docs carefully.
Severity rubric
| 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 |
Remediation patterns
- Use OZ
EIP712base +ECDSA.recover— handles s-bound, malleability, zero-address. - Include in every signed payload:
chainId,verifyingContract,nonce,deadline, plus any operation-specific fields. - Re-derive
DOMAIN_SEPARATORlazily whenblock.chainid != cached_chainid. - Nonces: per-signer monotonic OR per-order salt + on-chain seen-bitmap.
- For ERC-1271 (contract signers), validate via
isValidSignature(bytes32, bytes)returning the magic value.
False-positive notes
- Single-use bound to a specific consumed-event flag isn't strictly replayable — but still flag if the bound is fragile.
- Pure off-chain signatures never submitted on-chain don't have replay risk on chain, but watch for accidental reuse.
Related
- [[access-control]]
- [[bridge-specialist]] — validator set signatures
- [[mev-frontrunning]]
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

