The Ethereum Proof of Work (PoW) Chain, ETHW, has been scrambling to quell the claims that an on-chain replay attack hit it over the weekend. The Ethereum PoW fork is already off to a negative start. The smart contracts hack has triggered a collapse in prices. A blockchain security firm, BlockSec, alerted ETHW users of a replay attack in the network.
According to BlockSec, the replay attack occurred on September 16th. In this attack, the attackers obtained ETHW tokens by replaying Ethereum’s Proof of Stake (PoS) chain call data on the Ethereum fork PoW chain. Replay attacks are common when cryptocurrencies exist as a similar asset yet exist as separate blockchains. They are common in hard forks.
BlockSec, says that the root cause of the exploit was ETHW chain’s Omni cross-chain bridge. The bridge was using old ChainIDs and not correctly validating the correct ChainID for cross-chain messages. The Ethereum Mainnet and Testnet use two identifiers for different purposes: a Network ID and a Chain ID. Peer-to-peer messages between nodes use Network IDs, while transaction signing uses Chain IDs. EIP-155 introduced Chain ID to prevent replay attacks between ETH and Ethereum Classic (ETC) blockchains.
Events Leading to the ETWH Hack
By replaying similar transaction messages on Ethereum PoW, the hacker transferred 200 wrapped Ethereum ($260,000) using Omni bridge. OmniBridge is built on the Gnosis network, which is built on Ethereum Network.
The hacker aimed to receive 200 ETHW from the web and a copy of the OmniBridge smart contract. Almost 40 minutes after the exploit happened, the ETHW market plummeted from $8 to $5. It is unclear if the attacker cashed out the 200 ETHW stolen in the attack. How could the attack be possible, yet cryptocurrency is secure?
According to Gnosis Co-founder Martin Koppelman, the attack was possible because OmniBridge, which is on the PoW chain, continues to accept transactions pointing to the Chain ID of the Proof of Stake Ethereum blockchain.
This creates a variable that serves as a unique identifier for various blockchain networks. PoW forks use different ChainIDs to separate actions between the two networks. Because of this, the balance of the chain contract deployed on the PoW chain depletes.
Security researchers had warned users that such attacks against ETHW could occur in preparation for the fork. Gnosis co-founder Martin Koppelmann later said that both Gnosis and Ethereum were utterly unaffected.
Detecting and Preventing Ethereum Blockchain Smart Contract Reentrancy Attacks
Smart contracts are immutable, public, and distributed on the Ethereum blockchain. However, vulnerabilities can occur due to the developer’s programming. Between 2016 and 2018, seven cybersecurity incidents related to Ethereum smart contracts resulted in economic losses of over $289 million. Reentrancy vulnerabilities were at the root of two of these incidents.
The impact far exceeded the financial loss. Several reentrancy countermeasures are available based on defined patterns. These patterns help to prevent the exploitation of vulnerabilities before deploying smart contracts. Some current protective methods include;
- Smart Contracts Vulnerabilities Detection Tools
- F* Framework
- Security Based on Programming Languages
- Security Based on the Development of Smart Contracts
Developers should make sure to put security first. Just as the Ethereum Merge occurred in stages, crypto network upgrades too should appear in stages. This prevents any possibility of losing millions.