read-only-reentrancy-check
Skill220 starsChanged 20 days agoMITView on GitHub
Use when a composable DeFi integration exposes a pricing or share-value view that can be read while the owning protocol is mid-operation behind only a write-side non-reentrant guard, so an attacker re-enters through an ERC-721/1155 receiver or ETH-transfer hook and feeds a second consumer a skewed valuation to over-borrow, mint, or liquidate.
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
- erc1271-revert-data-checkSkill
- 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
- 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
1 rule. About 0 are common, 0 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
Add a medusa/echidna property spanning both protocols: "consumer valuation reads are never served from an inconsistent mid-operation state."
≈ “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
Read-Only Reentrancy Check
Audit composable DeFi integrations for read-only reentrancy: while a protocol is mid-operation (its state temporarily inconsistent and its non-reentrant write guard held), an attacker re-enters through an ERC-721/1155/777 receiver hook or a native-transfer callback and reads a view function (price, share value, collateral ratio) that returns a skewed value, which a second consuming protocol trusts to over-borrow, mint, or liquidate.
Source: corpus A §III.3 (OWASP SC08 read-only reentrancy) — strategy-to-vault state mismatches in
composable lending/AMM stacks.
Impact class: funds theft / vault drain via mispriced valuation (intrinsic).
Governing method: Phase-3a hypothesis lane of systematic-attacking; leads only into the
verification spine.
Method
- Identify every externally-callable view function used by other protocols for pricing/valuation
(
get_virtual_price,getReserves-derived quotes, share-to-asset conversions).slither+ manual mapping of cross-protocol consumers. - For each, check whether it can be read while the owning protocol holds only a write-side
nonReentrantguard (no read guard) during an operation that hands control to the caller (token callbacks, ETH transfers,remove_liquidity). - Map the consumer: a second protocol that reads that view mid-callback and acts on it (borrow, mint, liquidate).
- PoC on
anvil --fork: trigger the owning op, re-enter via the receiver hook, read the skewed view, and execute the over-borrow/mint on the consumer in the same transaction. Link-level negative control = the same read outside the reentrant window returns the correct value and the consumer action reverts/nets zero. - Add a
medusa/echidnaproperty spanning both protocols: "consumer valuation reads are never served from an inconsistent mid-operation state."
Acceptance
- Cross-protocol valuation views are enumerated with their reentrancy-window exposure classified.
- The PoC realizes a fund loss on a real fork by reading a skewed view mid-callback; the outside-window negative control does not.
- Finding names the view, the reentrancy window, and the consuming protocol; deduped 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.

