BPOI Banner
Onyx Protocol Loses $3.8 Million in Preventable Hack Onyx Protocol Loses $3.8 Million in Preventable Hack

How a Known Bug Led to a $3.8 Million Hack on Onyx Protocol

Onyx Protocol, a Compound Finance fork, suffered a $3.8 million loss on Thursday to mark another entry in a series of attacks as bad actors explore system vulnerability.

Cyber-attacks continue to plague the crypto industry, highlighting the need for enhanced security.  

$3.8 Million Hack Hits Onyx Protocol

Blockchain security firm PeckShield highlighted suspicious transactions on OnyxDAO, drawing attention to a possible attack on the protocol. In a follow-up post, the on-chain detective revealed losses reaching $3.8 million, indicating that the hacker was already swapping the funds.

Onyx Protocol Hack. Source: PeckShield

Web3 security firm Cyvers corroborated the incident, citing suspicious transactions involving OnyxDAO on the Ethereum blockchain. According to Cyvers, most of the loss was in VUSD stablecoin.

“Our system has detected a suspicious transaction involving OnyxDAO on the ETH chain! The total loss is around $3.2 million [at the time]. Most of the losses are in VUSD. Attacker currently holds 521 ETH ($1.36 million). The rest of the digital assets are not swapped yet,” Cyvers wrote.

Read more: Crypto Project Security: A Guide to Early Threat Detection

Additional investigations by PeckShield revealed that the attacker capitalized on a known precision issue presented as a bug in the forked Compound V2 code base. They then siphoned 4.1 million VUSD, 7.35 million XCN, 5,000 DAI, 0.23 WBTC, and 50,000 USDT. Reportedly, the bug leveraged a nearly empty market to manipulate the exchange rate.

Notably, hackers used the same approach in October 2023, hacking the same protocol for $2.1 million. In the October incident, the vulnerability was a rounding error. At the time, researchers ascribed the vulnerability to Onyx Protocol being a fork of Compound Finance.

How the Code Vulnerability Occurs

With many DeFi protocols being open-source, developers tend to avoid the long approach. They opt to build off of an existing code as opposed to implementing functionality from scratch.

The approach is considered popular as it can improve efficiency and security when done correctly. The downside is that if the template code is not secure, the fork may inherit the vulnerabilities.

“In the case of the Onyx protocol, the Compound Finance code that it used had a known vulnerability that had already been exploited in Hundred Finance and Midas Capital, which also forked the Compound Finance code. However, the Onyx Protocol used the same code and lacked the community support and vigilance needed to prevent the vulnerability from being exploited,” security firm Halborn reported.

This means the Onyx Protocol hack could have been prevented, given the prevalence of rounding errors. Notably, guidance already exists when launching new markets on Compound Finance and its forks.

“At Hexagate, we recommend any Compound V2 fork, when launching new markets to mint some cTokens and burn them to make sure the total supply never goes to zero. When the total supply goes to zero, the protocol becomes vulnerable and this strategy mitigates this situation,” security firm Hexgate guided in April 2023.

Read more: What Is Compound Finance?

These incidences, including a $4.6 million attack on decentralized infrastructure Truflation on Wednesday, reflect the prevalent challenge in the crypto industry, where bad actors use different mechanisms to steal digital assets.

Disclaimer

In adherence to the Trust Project guidelines, BeInCrypto is committed to unbiased, transparent reporting. This news article aims to provide accurate, timely information. However, readers are advised to verify facts independently and consult with a professional before making any decisions based on this content. Please note that our Terms and ConditionsPrivacy Policy, and Disclaimers have been updated.

Source link

Lockridge Okoth

https://beincrypto.com/onyx-protocol-preventable-hack/

2024-09-26 15:20:34

bitcoin
Bitcoin (BTC) $ 96,235.78 0.73%
ethereum
Ethereum (ETH) $ 3,345.93 0.94%
tether
Tether (USDT) $ 1.00 0.07%
xrp
XRP (XRP) $ 2.21 2.86%
bnb
BNB (BNB) $ 674.27 1.19%
solana
Solana (SOL) $ 185.04 0.33%
dogecoin
Dogecoin (DOGE) $ 0.316874 1.14%
usd-coin
USDC (USDC) $ 1.00 0.19%
staked-ether
Lido Staked Ether (STETH) $ 3,338.56 1.10%
cardano
Cardano (ADA) $ 0.898063 1.73%
tron
TRON (TRX) $ 0.249531 0.46%
avalanche-2
Avalanche (AVAX) $ 37.14 2.33%
chainlink
Chainlink (LINK) $ 23.12 2.25%
the-open-network
Toncoin (TON) $ 5.45 0.99%
wrapped-steth
Wrapped stETH (WSTETH) $ 3,957.14 1.45%
shiba-inu
Shiba Inu (SHIB) $ 0.000022 0.82%
wrapped-bitcoin
Wrapped Bitcoin (WBTC) $ 95,737.65 1.01%
sui
Sui (SUI) $ 4.36 2.96%
stellar
Stellar (XLM) $ 0.359416 2.55%
polkadot
Polkadot (DOT) $ 7.00 1.92%
hedera-hashgraph
Hedera (HBAR) $ 0.275495 3.20%
hyperliquid
Hyperliquid (HYPE) $ 27.96 18.45%
weth
WETH (WETH) $ 3,338.14 1.17%
bitcoin-cash
Bitcoin Cash (BCH) $ 446.82 2.46%
leo-token
LEO Token (LEO) $ 9.49 1.61%
uniswap
Uniswap (UNI) $ 13.95 1.39%
litecoin
Litecoin (LTC) $ 102.56 0.15%
pepe
Pepe (PEPE) $ 0.000018 0.46%
wrapped-eeth
Wrapped eETH (WEETH) $ 3,525.60 1.06%
near
NEAR Protocol (NEAR) $ 5.13 0.94%
ethena-usde
Ethena USDe (USDE) $ 1.00 0.17%
bitget-token
Bitget Token (BGB) $ 4.14 1.88%
usds
USDS (USDS) $ 1.00 0.47%
aptos
Aptos (APT) $ 9.25 3.10%
aave
Aave (AAVE) $ 338.83 9.91%
internet-computer
Internet Computer (ICP) $ 10.17 0.45%
crypto-com-chain
Cronos (CRO) $ 0.155891 2.45%
polygon-ecosystem-token
POL (ex-MATIC) (POL) $ 0.481765 0.91%
mantle
Mantle (MNT) $ 1.19 1.57%
ethereum-classic
Ethereum Classic (ETC) $ 26.47 0.09%
vechain
VeChain (VET) $ 0.046574 0.00%
render-token
Render (RENDER) $ 7.17 2.37%
monero
Monero (XMR) $ 191.56 0.79%
whitebit
WhiteBIT Coin (WBT) $ 24.46 0.42%
mantra-dao
MANTRA (OM) $ 3.61 3.84%
dai
Dai (DAI) $ 1.00 0.19%
bittensor
Bittensor (TAO) $ 459.00 1.83%
fetch-ai
Artificial Superintelligence Alliance (FET) $ 1.28 0.92%
arbitrum
Arbitrum (ARB) $ 0.764843 0.33%
ethena
Ethena (ENA) $ 1.05 2.87%