bg

Decoding What Went Wrong with Bedrock: $2M Exploit

Published on: October 18, 20247 Mins Read

Author:QuillAudits Team

How Did a $2M Exploit Sneak Through the Cracks?

In September 2024, Bedrock, a multi-asset liquid staking protocol, found itself in the crosshairs of a sophisticated exploit that drained around $2 million worth of crypto assets.

The attack primarily targeted uniBTC, a synthetic Bitcoin token issued by Bedrock, exposing a vulnerability that allowed hackers to mint excessive tokens without proper price calculation.

Let’s break down what happened, why it happened, and what can be done to prevent such exploits in the future.



TL;DR: Too Long? Here’s a Quick Recap!

  • Target: uniBTC (Bedrock’s synthetic BTC)
  • Exploit Impact: ~$2 million drained from liquidity pools
  • Root Cause: Price miscalculation during the minting process
  • Post-attack Action: Issue addressed, funds SAFU, reimbursement plan underway
  • Future Mitigation: Better alert systems, audits, and pricing validation

 

What’s Bedrock, Anyway?

Bedrock launched in February 2023 as a liquid restaking protocol, focusing on synthetic assets like uniBTC, uniETH, and uniIOTX. These synthetic tokens allow users to stake major blockchain tokens while still earning yield, making it attractive to both retail users and institutions looking to maximize their returns.

Bedrock quickly became one of the top liquid staking protocols with over $240 million in total value locked (TVL) on its platform.

bedrock

UniBTC, a wrapped version of Bitcoin, was the epicenter of this exploit. It’s designed to offer Bitcoin staking yields, while its security is dependent on the underlying smart contracts—making it crucial for these contracts to function without vulnerabilities.

 

How Did the Attack Happen?

The core of the Bedrock exploit was an issue in the mint function of the uniBTC contract.

Here’s a breakdown of how the hacker managed to slip past the defenses:

  1. Price Miscalculation: The mint function in the Bedrock contract allowed ETH to be minted into an equivalent amount of uniBTC. However, there was a flaw—the price difference between the assets wasn’t factored into the equation.
  2. Unlimited Minting Power: This gave the attacker the ability to mint uniBTC without proper checks, leading to a massive imbalance in the uniBTC pool.
  3. DEX Pool Drainage: Once the hacker minted an excess amount of uniBTC, they quickly swapped the tokens on decentralized exchanges like Uniswap. This drained liquidity pools tied to uniBTC, causing the price to crash on several trading pairs.

bedrock

 

Secure Your Smart Contracts with QuillAudits

Ready to secure your smart contracts? Take the first step towards a safer blockchain journey. Request an Audit with QuillAudits today & ensure your contracts are robust and secure!

Check Our Pricingarrow

What Was the Root Cause of the Exploit?

The primary reason for the hack was the flawed mint function in the uniBTC contract, which didn’t account for the price differential between ETH and uniBTC.

This opened the door for an attacker to deposit a small amount of ETH and mint uniBTC at a highly disproportionate rate. Essentially, the protocol created far more uniBTC than it should have, given the value of the deposited ETH.

 

Where Did the Money Go?

Once the hacker minted the excess uniBTC, they began to liquidate the tokens across DEXs.

According to our on-chain analysis:

  • 0x2bFB373017349820dda2Da8230E6b66739BE9F96 is the attacker’s address. They created a contract 0x0C8da4f8B823bEe4D5dAb73367D45B5135B50faB at 0x725f0d65340c859e0f64e72ca8260220c526c3e0ccde530004160809f6177940.

    1
     
  • The attacker’s address got funded by tornado cash 0x539744aceacdc24438f91e10720671c1096d4239d49230a9a631ee1d4a36bc8c

    2
     
  • The attacker sent 0.88 ETH to another address 0xEE800b1b63893Ca1E1b0FA8fEfDc10fAc9B980f7. At tx 0x60f098016f31d22e2e1127247948cfe59d39016a64c94e4569ca5d124fdbb404, they approved aETHWETH (Aave Ethereum Wrapped Ethereum) for trade on 0x893411580e590D62dDBca8a703d61Cc4A8c7b2b9.
     
  • Swapped 649.6 aETHWETH to ETH on contract 0x893411580e590D62dDBca8a703d61Cc4A8c7b2b.
     
  • Swapped the stolen uniBTC for ETH & at tx 0xd3ff8d55c26d87213a24178820907245f5b9b2563d6ea2cb4d9c114fd301a4d0, the attacker withdrew 649.6 ETH to 0xEE800b1b63893Ca1E1b0FA8fEfDc10fAc9B980f7.

    3
     
  • Total Stolen: Approximately 650 ETH (~$1.7M), plus smaller amounts in other assets, totaling around $2 million.
     
  • Current Holdings: At the time of analysis, the hacker’s address held most of the stolen funds in ETH. They took out most of the funds from 0xEE800b1b63893Ca1E1b0FA8fEfDc10fAc9B980f7 to Tornado Cash & multiple other addresses.

    4
     

What Did Bedrock Do Post-Hack?

Bedrock responded to the attack quickly, shutting down the affected contracts to prevent further losses. Key steps included:

  1. Pausing Contracts: The team swiftly paused the uniBTC contract, stopping any additional minting or transfers.
     
  2. Reassuring Users: Bedrock issued multiple statements assuring users that the underlying assets in reserve, such as wrapped BTC, remained secure. Only the synthetic uniBTC pool was impacted.
     
  3. Collaborating with White Hats: Bedrock is working closely with audit teams and white-hat hackers to trace the stolen funds and recover what’s possible. Bedrock also sent a message to the attacker to negotiate on the amount.

    5
     
  4. Reimbursement Plan: A detailed reimbursement plan is in the works to compensate users who lost funds in the exploit. This is crucial for restoring trust in the platform.

 

How Could This Have Been Prevented?

Security breaches like this one remind us of the fragility of DeFi protocols. Here’s how this attack could have been prevented:

  1. Price Validation Systems: The root of the issue was a pricing error. Implementing a robust price validation mechanism could have ensured the mint function adjusted for price fluctuations properly.
     
  2. Real-Time Security Alerts: Bedrock lacked a process for handling real-time alerts. With a system to monitor and react to potential exploits, the protocol might have caught the vulnerability before the attacker could fully capitalize on it.
     
  3. Thorough Audits: Regular smart contract audits from security firms like Quillaudits, especially for high-risk protocols like liquid staking, are critical. In this case, a deeper analysis of the mint function could have revealed the price miscalculation issue before it was exploited.
     
  4. Smarter Use of Limits: Introducing minting caps would have prevented any single address from creating excessive uniBTC in one go, limiting the damage in the event of an exploit.
Report Mockup

Secure Your Web3 Journey

The QuillAI Network is the AI layer for web3 security. With AI agents for solidity (QuillShield) and due diligence (QuillCheck) helping safeguard contracts, transactions, and wallets, QuillAI is empowering web3 users and builders to tke charge of their security needs.
Launch AI Agents

Why QuillAudits?

Choosing a reputable audit firm like QuillAudits ensures that your protocol undergoes rigorous scrutiny from experienced security professionals. QuillAudits specializes in uncovering critical vulnerabilities and providing actionable remediation strategies. 

Our expertise helps safeguard your project from attacks, ensuring that security issues are addressed proactively.

QuillAudits Team

QuillAudits Team

The QuillAudits team, comprises of expert security researchers & auditors in Web3 security, has completed 1,000+ audits across Ethereum, Polygon, Solana, Arbitrum, BSC, and more, securing $30B+ with 0 exploits, advancing the blockchain ecosystem

TwitterLinkedInTelegram

Subscribe to our Newsletter

Your weekly dose of Web3 innovation and security, featuring blockchain updates, developer insights, curated knowledge, security resources, and hack alerts. Stay ahead in Web3!

Telegram