Post-Ethereum Merge ETHW’s Proof of Work (PoW) chain has moved on to crack down on claims that it was hit by a network replay attack over the weekend.
Smart contract audit firm BlockSec noted what it described as a replay attack that took place on September 16, in which the attackers collected ETHW tokens by replicating Ethereum proof of stake (PoS) chain call data on the Ethereum PoW forked chain.
According to BlockSec, the root cause of the exploit was that the Omni bridge on the ETHW chain was using an old chain ID and incorrectly validating the correct crosschain message chain ID.
The main and testnets of Ethereum use two identifiers for different purposes, namely the network ID and the chain ID (chainID). Peer-to-peer messages between nodes use a network ID, while transaction signatures use a chain ID. EIP-155 introduced chainID as a means to prevent replay attacks between the ETH and Ethereum Classic (ETC) blockchains.
1/ Warning | BlockSec has detected that attackers are replaying the message (call data) of the PoS chain on @EthereumPow. The main reason for exploitation is that the bridge does not correctly check the actual circuit ID (which it maintains) of the cross-chain message.
— BlockSec (@BlockSecTeam) September 18, 2022
BlockSec was the first analytics service to flag the replay attack and notify ETHW, who in turn quickly debunked initial claims that the replay attack was carried out on the network. ETHW has made attempts to notify Omni Bridge of the exploit at the contract level:
Yesterday I tried by all means to contact Omni Bridge.
Bridges must properly validate the actual ChainID of cross-chain messages.
Again, this is not a transaction replay at the chain level, this is a call data replay due to a lack of a specific contract. pic.twitter.com/NZDn61cslJ
— EthereumPoW (ETHW) Official #ETHW #ETHPoW (@EthereumPoW) September 18, 2022
Analysis of the attack showed that the exploiter started by sending 200 WETH through the Omni bridge on the Gnosis chain, and then replayed the same message on the PoW chain, receiving an additional 200 ETHW. This resulted in depleting the balance of the chain contract deployed on the PoW chain.
Related: Cross-chains in sight: hacks require more effective defense mechanisms
BlockSec’s analysis of the source code of the Omni bridge showed that the logic to validate the chain ID was present, but the verified chain ID used in the contract was extracted from a value stored in a storage named unitStorage.
The team explained that this is an incorrect chain ID obtained using the CHAINID opcode that was proposed by EIP-1344 and exacerbated by the fork that occurred after the Ethereum merger:
“This is probably due to the fact that the code is quite old (using Solidity 0.4.24). The code works fine all the time until the fork of the PoW chain.”
This allowed attackers to collect ETHW and possibly other tokens owned by the bridge on the PoW chain and trade them on marketplaces that list the respective tokens. contacted BlockSec to find out the value extracted during the exploit.
After the successful Merge Ethereum event, during which the smart contract blockchain switched from PoW to PoS, a group of miners decided to continue the PoW chain through a hard fork.