/security-agent-skills:hunting-defi-economic-and-oracle-flawsfrom security-agent-skills
Hunts DeFi protocols for economic flaws where an attacker profits by moving a price or breaking an invariant, not by defeating access control or re-entering.
Ships in security-agent-skills. 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.
Some of the most valuable protocol bugs break no access check and re-enter nothing: they move a price or exploit accounting math to extract value through actions the protocol permits. A contract reads a spot price a flash loan can swing inside one transaction, trusts a pool ratio an attacker sets, or rounds a fee in a direction a repeated call drains. This hunt is about the economic layer, the values a protocol trusts and the invariants it assumes hold. It is distinct from access control (nothing here requires a missing gate) and from reentrancy (nothing here requires re-entry); if the fix is a manipulation-resistant oracle, a sanity bound, or corrected math, it is an economic flaw and belongs here. The discipline in a crowded field is proving the manipulation is profitable after costs, not just that a price can move.
Analyze only protocols you own or are authorized to assess, and simulate an economic exploit only on a fork or test network, a manipulation here extracts real value from real liquidity providers. Prove profitability on a fork. If you can't name the authorization, stop.
Find the value decisions and their inputs first. List the points where the protocol reads a price, a ratio, or a share value to move funds (a swap, a loan, a liquidation, a mint or redeem), and for each trace the input it trusts and whether an attacker can move that input within a transaction. The economic bug lives at a value decision that trusts a movable input; establish those before anything else.
Check the price source. Look for a price read from a spot source an attacker can move in the same transaction (a single pool's instantaneous ratio), a single-source oracle with no sanity bound or staleness check, or a feed that can be pushed outside a sane range without the protocol noticing.
Check flash-loan-amplified manipulation. Look for a decision that trusts a pool ratio or a balance an attacker can skew with borrowed capital for one transaction, swinging a price, a collateral valuation, or a liquidation threshold, then unwinding, so the attacker needs no capital of their own.
Check accounting, rounding, and share math. Look for a fee or reward computation that rounds in a direction a repeated interaction accumulates, share or collateral math that misprices the first or a precisely sized deposit, and an invariant (total shares versus total assets, debt versus collateral) that a sequence of permitted actions can break.
Check slippage and deadline protection. Look for a swap or trade that accepts an unchecked minimum output or an absent deadline, letting a sandwich or a delayed execution extract value the user did not agree to.
Confirm and record. Confirm by simulating the manipulation on a fork and showing a net profit after the cost of moving the price, the flash-loan fee, and gas. Kill the lead if the price comes from a manipulation-resistant source (a time-averaged or multi-source oracle with sanity and staleness bounds), if the decision already bounds or sanity-checks the value, if the rounding favors the protocol or the dust is economically negligible, if a share-inflation vector is closed (a minimum initial deposit, a dead-share mint, virtual offsets), if slippage and deadline are enforced, or if the manipulation costs more than it yields at realistic liquidity. Record the value decision, the movable input, and the profit path.
Confirm. A lending market values collateral using the spot ratio of a single pool; an attacker takes a flash loan, swings that pool to inflate their collateral's apparent value, borrows against the inflated valuation, and repays the loan, leaving the market with bad debt. A fork simulation shows a net profit after fees and gas. Confirmed oracle manipulation via a spot-price collateral valuation,
critical, remediation = value collateral with a manipulation-resistant, time-averaged, multi-source oracle with sanity and staleness bounds.Kill. A protocol reads a price that looks spot, but it comes from a time-averaged oracle over a window long enough that a single-transaction swing barely moves it, with a staleness check and a sanity bound rejecting outliers; a fork attempt to move the effective price nets a loss after the cost of holding the swing. Killed,
kill_reason= "the price is a bounded time-averaged multi-source feed, so single-transaction manipulation is not profitable after cost."
You need the value decisions (swaps, loans, liquidations, mints, redeems), the price, ratio, and share inputs each trusts and whether an attacker can move them in a transaction, the oracle sources and their bounds, the fee, rounding, and share math, and the slippage and deadline handling. For each decision, simulate whether moving the input yields a net profit after cost on a fork. Reading the code tells you which input is trusted; the fork simulation tells you whether manipulating it pays.
hunting-smart-contract-reentrancy - the sibling for control-flow re-entry, including a read-only
reentrancy that feeds a mid-transaction value into a pricing decision this skill then adjudicates.auditing-smart-contract-access-control - the sibling for missing or defeated gates; a privileged
parameter setter reachable by the wrong caller that skews pricing starts there and lands here.hunting-business-logic-flaws - the general analogue: extracting value through permitted actions in an
unintended sequence, of which economic manipulation is the on-chain form.What SKILL.md sets; muted values are Claude Code's defaults
194 skills in this plugin
/adjudicating-dependency-cve-reachabilityDecide whether a CVE in a dependency actually exposes your application before you scramble to patch: is the vulnerable function on a real call path from your code, do the trigger preconditions hold, and can an attacker control the input that reaches it. Use when an advisory, SCA scan, or dependency bot flags a CVE and you must separate a genuine exposure from unreachable noise, or justify why you are or are not affected. Covers pinning the vulnerable symbol, call-path reachability, precondition checks, and taint from your entry points./adjudicating-taint-pathsDecide whether a whitebox lead is a real bug by tracing taint from an untrusted source to a dangerous sink and confirming every hop against live source. Use after a scanner, a candidate list, or your own reading surfaces a "this looks dangerous" sink (SQL exec, system/exec, file open, deserialize, template render, redirect target, memcpy) and you must decide whether attacker- controlled input actually reaches it - or kill the lead with evidence. Covers forward and reverse taint, witness paths, sanitizer analysis, and the evidence rules that separate a finding from a false positive.npx claudepluginhub unboundcompute/security-agent-skills --plugin security-agent-skillsOther plugins' skills for the same job