Onyx Protocol Hack

TOTAL LOST $2.1M
Medium Flashloan Donate Function Logic Exploit / Flash Loan Attack ethereum

Summarize with AI

Affected Chain ethereum Incident surface
Recovered - No recovery reported
All-Time Rank #633 By amount stolen
Auditors 1 Prior security audit

Incident Overview

Onyx Protocol suffered a flash loan attack, exploiting a rounding issue, leading to a loss of approximately 2,149,772 USD worth 1,161.29 ETH.

Onyx Protocol, a decentralized liquidity protocol, was exploited on November 1, 2023, through a flash loan attack. The attacker took advantage of a critical vulnerability in CompoundV2 forks, which caused a known rounding issue. To execute the exploit, the attacker took out a substantial flash loan in ETH, swiftly converting it to PEPE tokens and contributing PEPE tokens to a specific pool.

Due to precision loss, fewer shares were burned, enabling the withdrawal of assets. The exploit resulted in a loss of approximately 2,149,772 USD worth 1,161.29 ETH. The attacker has already laundered about 1,140 ETH (equivalent to 1.25 million USD) to the crypto mixing service Tornado Cash.

Attacker Addresses:

https://etherscan.io/address/0x085bDfF2…642BfF

https://etherscan.io/address/0x4C9C8661…330c98

https://etherscan.io/address/0x50839563…842706

Malicious Transaction:

https://etherscan.io/tx/0x27a3788d…899746

Malicious Contract:

https://etherscan.io/address/0x052Ad2f7…3fcEAa

TornadoCash Deposit Transactions:

https://etherscan.io/tx/0xf045dff0…ffd33e

https://etherscan.io/tx/0x3990b142…675e3c

https://etherscan.io/tx/0x17cc492f…ac2ca4

Incident Report

Protocol / Project Onyx Protocol
Date of Incident
Affected Chain(s) ethereum
Attack Technique Flashloan Donate Function Logic Exploit / Flash Loan Attack
Classification Ecosystem / Borrowing and Lending
Primary Source View Post-Mortem

Protocol Information

Protocol Type Lending
Affected Token XCN
Smart Contract Language Solidity
Official Website onyx.org/
Protocol Twitter/X @OnyxProtocol
Team Anonymous
Source Code Unverified

Market Context at Time of Hack

Token Categories
Collectibles & NFTs DeFi Gaming DAO Ethereum Ecosystem Yield Farming Governance Avalanche Ecosystem

What the Attacker Needed to Succeed

Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.

Technical Knowledge Deep understanding of flashloan donate function logic exploit / flash loan attack and Solidity and EVM internals
Capital Required Flash loan capital (borrowed atomically, zero upfront cost)
On-Chain Access Ability to interact with ethereum smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in Onyx Protocol's contract logic - root cause: ecosystem / borrowing and lending
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single atomic block
Obfuscation Plan A strategy to launder and move stolen funds - typically through mixers, cross-chain bridges, or decentralized DEX swaps to resist tracing

What Auditors Should Check

Could this have been caught in audit? Yes — skilled auditors routinely flag Flashloan Donate Function Logic Exploit / Flash Loan Attack vulnerabilities in code review
Audited by Audit Report 1 — still lost $2.1M. Prior audits don't guarantee safety, especially after post-audit code changes.

If you're auditing a protocol with similar architecture to Onyx Protocol, these are the critical security checks that could have prevented this incident (November 2023).

  • Verify all logic paths related to Flashloan Donate Function Logic Exploit / Flash Loan Attack are guarded by proper access controls and input validation - see the Flash Loans Attacks attack class for patterns
  • Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs

Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.

Free Trial

Security Audit History

Related Attack Classes

The technique used in this hack maps to these vulnerability classes in our security curriculum:

See all Flash Loans Attacks examples →

Sources & References

Learn to Prevent the Next Onyx Protocol

The Onyx Protocol hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.

Recreate exploit patterns safely Free Trial