Toutes les vulnérabilités
HIGHWeb3

WEB3-ONYX-2023

Web3 · Ethereum · Onyx Protocol (Compound v2 fork)

Résumé

On November 1, 2023 Onyx Protocol, a Compound v2 lending fork on Ethereum, lost about $2.1 million, and the same unfixed bug class was exploited again in September 2024 for about $3.8 million. A newly added, unfunded oPEPE market was left with zero supply because the protocol skipped the standard practice of minting and burning initial cTokens. The attacker used an Aave/Balancer flash loan to mint a tiny amount of oPEPE in the empty market, then donated PEPE directly into the contract to inflate the cToken exchange rate, exploiting the rounding in exchangeRate at low totalSupply. With the artificially over-valued oPEPE counted as collateral, the attacker borrowed other assets and, on redemption, the truncation let them withdraw more value than they supplied, draining the protocol. The September 2024 repeat applied the same empty-market exchange-rate manipulation to a fresh VUSD/oETH market plus an NFTLiquidation input-validation flaw.

Comment l’éviter dans votre code

  • Never enable a market with zero total supply; require a protocol-owned initial mint and burn of cTokens before listing it as collateral.
  • Derive exchangeRate from internally tracked cash so direct token donations cannot inflate price-per-cToken.
  • Round mint and redeem in the protocol's favour and reject dust mints that destabilize the exchange rate in low-liquidity markets.
  • Validate all untrusted user input in liquidation paths and bound self-liquidation rewards.
  • Cap per-block exchangeRate growth and cross-check collateral value against an external oracle before borrows.

Références

Vulnérabilités liées

Tout Web3 →