erc1271-revert-data-check
Skill220 starsChanged 19 days agoMITView on GitHub
Use when a contract validates a smart-contract-wallet signature by low-level-calling isValidSignature and you suspect the revert-data trick — the call's EVM success flag is discarded, so an attacker-deployed verifier that reverts with the 0x1626ba7e magic value in its reason is misread as a valid signature and authorizes a drain.
In this repository179 other files it gives its agents.
- AGENTS.mdAGENTS.md
- chrono/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- accessible-media-authoringSkill
- agentic-safety-auditSkill
- agent-prompt-engineeringSkill
- audio-event-map-authoringSkill
- auto-scaffoldSkill
- chain-constructSkill
- chain-construct-smart-contractSkill
- claim-verificationSkill
- code-reachability-auditSkill
- code-review-loopSkill
- color-theorySkill
- conversation-designSkill
- copy-refinementSkill
- cosmos-sdk-audit-checklistSkill
- cross-chain-bridge-auditSkill
- cross-file-relationship-synthesisSkill
- data-flow-traceSkill
- dedup-prior-art-checkSkill
- defi-invariant-checkSkill
- dependency-cycle-auditSkill
- dependency-health-triageSkill
- detection-as-codeSkill
- diff-aware-semgrep-scanSkill
- differential-reviewSkill
- dimensional-analysis-checkSkill
- dual-level-retrievalSkill
- durable-nonce-exploitationSkill
- error-based-sstiSkill
- evm-audit-flowSkill
- figma-implement-designSkill
- findings-filterSkill
- forensic-timeline-authoringSkill
- game-design-fundamentalsSkill
- game-mechanics-balancingSkill
- head-tailSkill
- incident-response-runbookSkill
- interactive-audio-designSkill
- interface-ambiguity-checkSkill
- keyword-clusteringSkill
- knowledge-base-integrationSkill
- known-advisory-backport-checkSkill
- layered-analysis-loopSkill
- level-design-patternsSkill
- locale-adaptationSkill
- multi-stance-audit-fanoutSkill
- narrative-structureSkill
- osint-platform-auditSkill
- parser-differential-route-confusionSkill
- persuasive-technical-writingSkill
- platform-complianceSkill
- player-engagement-psychologySkill
- pre-audit-threat-modelSkill
- program-rubric-lookupSkill
- read-only-reentrancy-checkSkill
- requirements-elicitationSkill
- review-severity-ladderSkill
- rule6-rights-gateSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
Add a halmos/forge invariant: "no auth path accepts a signature whose verifier call returned success == false."
- Distinctive: line 38
Every ERC-1271 / low-level-signer call site is enumerated with its success-flag handling classified.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
ERC-1271 Revert-Data Confusion Check
Audit smart-contract-wallet signature validation for the "revert-data trick": a low-level
staticcall/call to isValidSignature(hash,sig) whose EVM success flag is ignored, so an
attacker-deployed verifier that reverts with the ERC-1271 magic value (0x1626ba7e) in its
revert reason is misread as a valid signature — authorizing a drain.
Source: corpus A §I.3 — ChainSecurity / Zodiac Roles Modifier / Gnosis Pay, June 2026 (~$1.5M).
Impact class: funds theft / full wallet drain (intrinsic — clears the impact bar).
Governing method: a Phase-3a hypothesis lane of systematic-attacking; emits a lead only —
it re-enters the Phase 4–8 verification spine (runnable PoC on a mainnet fork, negative control,
G1–G4, cross-family repro) before it is ever a finding.
Method
- Grep the target for every ERC-1271 consumer:
isValidSignature, the0x1626ba7emagic value, and low-levelstaticcall/callinto a signer address (slither,semgrepcustom rule,castfor on-chain bytecode). - For each call site, confirm the code checks the call's success boolean BEFORE decoding
returnData. The bug pattern is(, bytes memory ret) = signer.staticcall(...)followed byret[:4] == MAGICwith the success flag discarded, or anassembly { returndatacopy }that never checkssuccess. - Build the differential PoC in Foundry: deploy a malicious verifier that
reverts withabi.encode(0x1626ba7e)(or raw bytes) in its reason; call the target's auth path with it as the declared signer. forgetest on ananvil --forkof the real deployment: assert the drain succeeds against the live contract state, then assert a success-checked reference implementation rejects it (link-level negative control).- Add a
halmos/forgeinvariant: "no auth path accepts a signature whose verifier call returnedsuccess == false."
Acceptance
- Every ERC-1271 / low-level-signer call site is enumerated with its success-flag handling classified.
- The PoC drains against a real mainnet fork, not a mock, and the negative control (success-checked variant) rejects the same input.
- Finding names the exact call site, the ignored success flag, and the realized fund impact; it is deduped against prior Zodiac/ERC-1271 disclosures before submission.
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.

