Onyx Protocol oPEPE Hack

Reported loss $2.1M
Ethereum
Empty-market exchange-rate inflation and redemption rounding

What happened

On November 1, 2023, an attacker drained about $2.15 million from Onyx Protocol's Ethereum lending markets after exploiting the newly activated oPEPE market. A near-empty receipt-token market allowed the attacker to inflate oPEPE's exchange rate through a direct PEPE donation, then use a rounding flaw in the Compound-derived accounting to turn that distorted value into borrowable collateral.

Technical root cause

A freshly deployed, insufficiently seeded receipt-token market permitted donation-driven cash-to-share exchange-rate inflation. With near-zero oPEPE supply, Compound-fork integer rounding in the redemption path failed to charge meaningful shares for withdrawn underlying.

How it happened

  1. The attacker activated the new oPEPE market through the governance proposal and used a flash loan to acquire PEPE.
  2. Minting and redeeming oPEPE reduced receipt-token supply to a tiny balance. A direct PEPE donation then sharply increased the cash backing each remaining share.
  3. The attacker borrowed against that inflated collateral. At the extreme exchange rate, redeemUnderlying() rounded down the number of shares required to withdraw underlying tokens.
  4. Borrowing and redemption drained other Onyx markets before the flash loan was repaid.

The critical combination was a nearly empty market, donation-sensitive accounting, and redemption rounding. The flash loan supplied capital; it was not itself the vulnerability.

Protocol details

Classification Token accounting failure
Protocol Type Lending
Affected asset / contract XCN
Implementation language Solidity
Protocol links Website @OnyxProtocol

Security review history

Understand the attack patterns

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.