Tl;dr: In this piece we share critical lessons about the nature of the Celer Bridge compromise, attacker on-chain and off-chain techniques and tactics during the incident, as well as security tips for similar projects and users. Building a better crypto ecosystem means building a better, more equitable future for us all. That’s why we are investing in the larger community to make sure anyone who wants to participate in the cryptoeconomy can do so in a secure way.
While the Celer bridge compromise does not directly affect Coinbase, we strongly believe that attacks on any crypto business are bad for the industry as a whole and hope the information in the blog will help strengthen and inform similar projects and their users about threats and techniques used by malicious actors.
If any dapps or service providers think they’ve been impacted by a frontend hijack like this, please reach out to us at firstname.lastname@example.org
By: Peter Kacherginsky, Threat Intelligence
On August 17, 2022, Celer Network Bridge dapp users were targeted in a front-end hijacking attack which lasted approximately 3 hours and resulted in 32 impacted victims and $235,000 USD in losses. The attack was the result of a Border Gateway Protocol (BGP) announcement that appeared to originate from the QuickHostUk (AS-209243) hosting provider which itself may be a victim. BGP hijacking is a unique attack vector exploiting weakness and trust relationships in the Internet’s core routing architecture. It was used earlier this year to target other cryptocurrency projects such as KLAYswap.
Unlike the Nomad Bridge compromise on August 1, 2022, front-end hijacking primarily targeted users of the Celer platform dapp as opposed to the project’s liquidity pools. In this case, Celer UI users with assets on Ethereum, BSC, Polygon, Optimism, Fantom, Arbitrum, Avalanche, Metis, Astar, and Aurora networks were presented with specially crafted smart contracts designed to steal their funds.
Ethereum users suffered the largest monetary losses with a single victim losing $156K USD. The largest number of victims on a single network were using BSC, while users of other chains like Avalanche and Metis suffered no losses.
The attacker performed initial preparation on August 12, 2022 by deploying a series of malicious smart contracts on Ethereum, Binance Smart Chain (BSC), Polygon, Optimism, Fantom, Arbitrum, Avalanche, Metis, Astar, and Aurora networks. Preparation for the BGP route hijacking took place on August 16th, 2022 and culminated with the attack on August 17, 2022 by taking over a subdomain responsible for serving dapp users with the latest bridge contract addresses and lasted for approximately 3 hours. The attack stopped shortly after the announcement by the Celer team, at which point the attacker started moving funds to Tornado Cash.
The following sections explore each of the attack stages in more detail as well as the Incident Timeline which follows the attacker over the 7 day period.
The attack targeted the cbridge-prod2.celer.network subdomain which hosted critical smart contract configuration data for the Celer Bridge user interface (UI). Prior to the attack cbridge-prod2.celer.network (22.214.171.124) was served by AS-16509 (Amazon) with a 126.96.36.199/11 route.
On August 16, 2022 17:21:13 UTC, a malicious actor created routing registry entries for MAINT-QUICKHOSTUK and added a 188.8.131.52/24 route to the Internet Routing Registry (IRR) in preparation for the attack:
Figure 1 — Pre-attack router configuration (source: Misaka NRTM log by Siyuan Miao)
Starting on August 17, 2022 19:39:50 UTC a new route started propagating for the more specific 184.108.40.206/24 route with a different origin AS-14618 (Amazon) than before, and a new upstream AS-209243 (QuickHostUk):
Figure 2 — Malicious route announcement (source: RIPE Raw Data Archive)
Since 220.127.116.11/24 is a more specific path than 18.104.22.168/11 traffic destined for cbridge-prod2.celer.network started flowing through the AS-209243 (QuickHostUk) which replaced key smart contract parameters described in the Malicious Dapp Analysis section below.
Figure 3 — Network map after BGP hijacking (source: RIPE)
In order to intercept rerouted traffic, the attacker created a valid certificate for the target domain first observed at 2022–08–17 19:42 UTC using GoGetSSL, an SSL certificate provider based in Latvia.  
Figure 4 -Malicious certificate (source: Censys)
Prior to the attack, Celer used SSL certificates issued by Let’s Encrypt and Amazon for its domains.
On August 17, 2022 20:22:12 UTC the malicious route was withdrawn by multiple Autonomous Systems (ASs):
Figure 5 — Malicious route withdrawal (source: RIPE Raw Data Archive)
Shortly after at 23:08:47 UTC Amazon announced 22.214.171.124/24 to reclaim hijacked traffic:
Figure 6 — Amazon claiming hijacked route (source: RIPE Raw Data Archive)
The first set of funds stolen through a phishing contract occurred at 2022–08–17 19:51 UTC on the Fantom network and continued until 2022–08–17 21:49 UTC when the last user lost assets on the BSC network which aligns with the above timeline concerning the project’s network infrastructure.
The attack targeted a smart contract configuration resource hosted on cbridge-prod2.celer.network such as https://cbridge-prod2.celer.network/v1/getTransferConfigsForAll holding per chain bridge contract addresses. Modifying any of the bridge addresses would result in a victim approving and/or sending assets to a malicious contract. Below is a sample modified entry redirecting Ethereum users to use a malicious contract 0x2A2a…18E8.
Figure 7 — Sample Celer Bridge configuration (source: Coinbase TI analysis)
See Appendix A for a comprehensive listing of malicious contracts created by attackers.
The phishing contract closely resembles the official Celer Bridge contract by mimicking many of its attributes. For any method not explicitly defined in the phishing contract, it implements a proxy structure which forwards calls to the legitimate Celer Bridge contract. The proxied contract is unique to each chain and is configured on initialization. The command below illustrates the contents of the storage slot responsible for the phishing contract’s proxy configuration:
Figure 8 — Phishing smart contract proxy storage (source: Coinbase TI analysis)
The phishing contract steals users’ funds using two approaches:
- Any tokens approved by phishing victims are drained using a custom method with a 4byte value 0x9c307de6()
- The phishing contract overrides the following methods designed to immediately steal a victim’s tokens:
- send()- used to steal tokens (e.g. USDC)
- sendNative() — used to steal native assets (e.g. ETH)
- addLiquidity()- used to steal tokens (e.g. USDC)
- addNativeLiquidity() — used to steal native assets (e.g. ETH)
Below is a sample reverse engineered snippet which redirects assets to the attacker wallet:
Figure 9 — Phishing smart contract snippet (source: Coinbase TI analysis)
See Appendix B for the complete reverse engineered source code.
During and immediately following the attack:
- The attacker swapped stolen tokens on Curve, Uniswap, TraderJoe, AuroraSwap, and other chain-specific DEXs into each chain’s native assets or wrapped ETH.
- The attacker bridged all assets from Step 1 to Ethereum.
- The attacker then proceeded to swap the remaining tokens on Uniswap to ETH.
- Finally, the attacker sent 127 ETH at 2022–08–17 22:33 UTC and another 1.4 ETH at 2022–08–18 01:01 UTC to Tornado Cash.
The diagram below illustrates the multi-chain bridging and swapping flow used by the attacker prior to sending assets to Tornado Cash:
Figure 10 — Asset swapping and obfuscation diagram (source: Coinbase TI)
Interestingly, following the last theft transaction on 2022–08–17 21:49 UTC from a victim on BSC, there was another transfer on 2022–08–18 02:37 UTC by 0xe35c…aa9d on BSC more than 4 hours later. This address was funded minutes prior to this transaction by 0x975d…d94b using ChangeNow.
The attacker was well prepared and methodical in how they constructed phishing contracts. For each chain and deployment, the attacker painstakingly tested their contracts with previously transferred sample tokens. This allowed them to catch multiple deployment bugs prior to the attack.
The attacker was very familiar with available bridging protocols and DEXs, even on more esoteric chains like Aurora shown by their rapid exchange, bridging, and steps to obfuscate stolen assets after they were discovered. Notably, the threat actor chose to target less popular chains like Metis, Astar, and Aurora while going to great lengths to send test funds through multiple bridges.
Transactions across chains and stages of the attack were serialized, indicating a single operator was likely behind the attack.
Performing a BGP hijacking attack requires a specialized networking skill set which the attacker may have deployed in the past.
Web3 projects do not exist in a vacuum and still depend on the traditional web2 infrastructure for many of their critical components such as dapps hosting services and domain registrars, blockchain gateways, and the core Internet routing infrastructure. This dependency introduces more traditional threats such as BGP and DNS hijacking, domain registrar takeover, traditional web exploitation, etc. to otherwise decentralized products. Below are several steps which may be used to mitigate threats in appropriate cases:
Enable the following security controls, or consider using hosting providers that have enabled them, to protect projects infrastructure:
- RPKI to protect hosting routing infrastructure.
- DNSSEC and CAA to protect domain and certificate services.
- Multifactor authentication or enhanced account protection on hosting, domain registrar, and other services.
- Limit, restrict, implement logging and review on access to the above services.
Implement the following monitoring both for the project and its dependencies:
- Implement BGP monitoring to detect unexpected changes to routes and prefixes (e.g. BGPAlerter)
- Implement DNS monitoring to detect unexpected record changes ( e.g. DNSCheck)
- Implement certificate transparency log monitoring to detect unknown certificates associated with project’s domain (e.g. Certstream)
- Implement dapp monitoring to detect unexpected smart contract addresses presented by the front-end architecture
DeFi users can protect themselves from front-end hijacking attacks by adopting the following practices:
- Verify smart contract addresses presented by a Dapp with the project’s official documentation when available.
- Exercise vigilance when signing or approving transactions.
- Use a hardware wallet or other cold storage solution to protect assets you don’t regularly use.
- Periodically review and revoke any contract approvals you don’t actively need.
- Follow project’s social media feeds for any security announcements.
- Use wallet software capable of blocking malicious threats (e.g. Coinbase Wallet).
Coinbase is committed to improving our security and the wider industry’s security, as well as protecting our users. We believe that exploits like these can be mitigated and ultimately prevented. Besides making codebases open source for the public to review, we recommend frequent protocol audits, implementation of bug bounty programs, and partnering with security researchers. Although this exploit was a difficult learning experience for those affected, we believe that understanding how the exploit occurred can only help further mature our industry.
We understand that trust is built on dependable security — which is why we make protecting your account & your digital assets our number one priority. Learn more here.
2022–08–12 14:33 UTC — 0xb0f5…30dd funded from Tornado Cash on Ethereum.
Bridging to BSC, Polygon, Optimism, Fantom, Arbitrum, and Avalanche
NOTE: Attacker forgot to specify Celer proxy contract.
NOTE: Attacker specified the wrong Celer proxy from the BSC network.
Bridging to Astar and Aurora
Bridging to Metis
Routing Infrastructure configuration
2022–08–16 17:21 UTC — Attacker updates IRR with AS209243, AS16509 members.
2022–08–16 17:36 UTC — Attacker updates IRR to handle 126.96.36.199/24 route.
2022–08–17 19:39 UTC — BGP Hijacking of 188.8.131.52/24 route.
2022–08–17 19:51 UTC — First victim observed on Fantom.
2022–08–17 21:49 UTC — Last victim observed on BSC.
2021–08–17 21:56 UTC — Celer Twitter shares reports about a security incident.
2022–08–17 22:12 UTC — BGP Hijacking ends and 184.108.40.206/24 route withdrawn.
2022–08–17 22:33 UTC — Begin depositing 127 ETH to Tornado Cash on Ethereum.
2022–08–17 23:08 UTC — Amazon AS-16509 claims 220.127.116.11/24 route.
2022–08–17 23:45 UTC — The last bridging transaction to Ethereum from Optimism.
2022–08–17 23:53 UTC — The last bridging transaction to Ethereum from Arbitrum.
2022–08–17 23:48 UTC — The last bridging transaction to Ethereum from Polygon.
2022–08–18 00:01 UTC — The last bridging transaction to Ethereum from Avalanche.
2022–08–18 00:17 UTC — The last bridging transaction to Ethereum from Aurora.
2022–08–18 00:21 UTC — The last bridging transaction to Ethereum from Fantom.
2022–08–18 00:26 UTC — The last bridging transaction to Ethereum from BSC.
2022–08–18 01:01 UTC — Begin depositing 1.4 ETH to Tornado Cash on Ethereum.
2022–08–18 01:33 UTC — Transfer 0.01201403570756 ETH to 0x6614…fcd9.
AS: 209243 (AS number observed in the path on routing announcements and as a maintainer for the prefix in IRR changes)