0G Labs Hack

Reported loss $516K
0G
emergencyWithdraw Function Exploit

What happened

On December 11, 2025, an attacker drained 520,010 0G tokens from a 0G reward distribution contract. CertiK valued them at about $516K. The attacker also took 9.93 ETH and about $4.2K USDT. The stolen 0G was bridged to another chain and laundered through Tornado Cash.

The contract itself was not the weak point. The 0G Foundation said the key controlling it was stored in plaintext on an Alibaba Cloud (AliCloud) server. From December 5, the attacker exploited the Next.js vulnerability CVE-2025-66478 on 0G's AliCloud instances. It then moved laterally through internal services, including alignment, validator node, NFT and node-sale services. With the leaked private key, the attacker called the contract's privileged emergency-withdrawal function and withdrew the reward tokens.

The Foundation said core chain infrastructure was not affected and no additional losses tied to user-held assets had been found. It rotated the compromised keys, rebuilt and patched the affected services, removed plaintext keys, and said it would move signing to trusted execution environments with multi-signature controls.

How it happened

  1. From December 5, 2025, the attacker used CVE-2025-66478 in Next.js to compromise 0G's AliCloud instances and moved laterally between internal services.
  2. On one of those servers, the attacker found the plaintext private key used to manage the reward contract.
  3. On December 11, the attacker used the key to call the reward contract's privileged emergency-withdrawal function and took 520,010 0G.
  4. The attacker bridged the 0G to another chain and routed it through Tornado Cash. CertiK flagged the activity on December 12.

Protocol details

Classification Protocol Logic
Protocol Type DeFi Protocol
Implementation language Solidity

Build your security review skills

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