Skip to main content
Web3 red teaming applies adversarial thinking to blockchain-based systems with the goal of identifying how an attacker could steal funds, manipulate state, or take control of a protocol. Unlike traditional red teaming, every action on-chain is permanently recorded and potentially front-run.

Value-centric methodology

The core principle: follow the money. Identify every component that can move funds and every path that leads to it.
1

Inventory value-bearing components

Map out all components that hold or can move value:
  • Multisig signers and their threshold configuration
  • Oracle contracts and their update permissions
  • Bridges and their validator sets
  • Automation (Gelato, Chainlink Automation) and their trigger conditions
  • Admin keys and timelock configurations
2

Map to adversarial tactics

Apply MITRE AADAPT tactics to each component:
  • Who can call withdraw(), mint(), upgradeProxy()?
  • Can flash loans amplify any of these?
  • What happens if an oracle is stale or manipulated?
  • Can a bridge validator set be corrupted?
3

Rehearse attack chains

Model end-to-end scenarios that chain multiple primitives:
  • Flash loan → oracle manipulation → liquidation → profit
  • Compromised signer key → proxy upgrade → drain treasury
  • Malicious cross-chain message → mint tokens on destination chain
4

Validate and document

For each viable chain: write a PoC (using Foundry fork tests), measure impact in USD, and document the prerequisites and mitigations.

DeFi exploit patterns

Flash loan amplification

Flash loans allow borrowing arbitrary amounts within a single transaction at zero upfront cost. They amplify any vulnerability that depends on token balances:

AMM precision abuse (Uniswap v4 hooks)

Uniswap v4 hooks allow custom logic before/after swaps. Precision and rounding vulnerabilities in hooks can be exploited:
  • Rounding direction: a hook that rounds fees in favour of the attacker on each swap can drain the pool over many micro-swaps
  • Threshold crossing: a hook that triggers a large bonus when liquidity crosses a threshold can be triggered with a tiny swap that costs almost nothing but receives the full bonus
  • Virtual balance poisoning: AMMs that cache virtual balances can be poisoned when totalSupply == 0 — the first depositor can set an arbitrary exchange rate

Oracle attacks

Signing workflow compromise

Wallet UIs present transaction data to users for signing. A compromised frontend can mutate the data before it is signed:

EIP-712 payload tampering

This is particularly effective against Safe (Gnosis Safe) multisig proxies that use delegatecall to the implementation — overwriting the masterCopy slot gives the attacker full control. Mitigations:
  • Verify transaction calldata on a trusted device before signing
  • Use hardware wallets that display decoded calldata
  • Check implementation addresses on-chain before approving upgrades
  • Use timelocks on all admin actions to allow monitoring

Bridge attacks

Cross-chain bridges are among the highest-value targets in DeFi (billions lost to bridge hacks):

Bridge testing checklist

  • Message nonce/replay protection is enforced on the destination chain
  • Validator threshold cannot be reduced to 1 by the bridge admin
  • Lock events on the source chain are cryptographically committed before minting on the destination
  • Emergency pause/veto mechanism exists and is controlled independently of the bridge admin
  • No single key or contract can unilaterally drain the bridge

Key management attacks

Foundry fork testing for exploit development

Resources