Bent Finance Malicious Balance Injection

From Quadriga Initiative Cryptocurrency Hacks, Scams, and Frauds Repository
Jump to navigation Jump to search

Notice: This page is a new case study and some aspects have not been fully researched. Some sections may be incomplete or reflect inaccuracies present in initial sources. Please check the References at the bottom for further information and perform your own additional assessment. Please feel free to contribute by adding any missing information or sources you come across. If you are new here, please read General Tutorial on Wikis or Anatomy of a Case Study for help getting started.

Notice: This page contains sources which are not attributed to any text. The unattributed sources follow the initial description. Please assist by visiting each source, reviewing the content, and placing that reference next to any text it can be used to support. Feel free to add any information that you come across which isn't present already. Sources which don't contain any relevant information can be removed. Broken links can be replaced with versions from the Internet Archive. See General Tutorial on Wikis, Anatomy of a Case Study, and/or Citing Your Sources Guide for additional information. Thanks for your help!

Bent Finance

The Bent Finance platform suffered from a malicious injection during the development of their smart contract hot wallet. This resulted in one of the developers giving themselves a very large balance, which was not discovered for 20 days. The malicious developer was eventually convinced to return the stolen funds, and the community made up the difference which occurred based on the value falling.

This is a global/international case not involving a specific country.[1][2][3][4][5][6][7][8][9][10][11][12]

About Bent Finance

"Bent is a staking and farming platform to enhance your curve returns, by the people for the ppl."

"Like CVX, BENT has been developed by an “anon team” and is more or less to CVX what CVX is to CRV, this is how it works: Anon will deposit stables to Curve but not “stake in gauge”. Instead of staking these Curve LP tokens in Convex, they stake them in BENT which yields out all of the Convex rewards they would have received by directly staking on Convex minus 17% (more on this below) plus this yields a healthy amount of BENT, which will make up for and more than the 17% slash. Keep in mind this system is emulated from convex which itself takes a 17% clip from crv deposits."

"Anon can also stake in the DAI/BENT pool on Sushi Swap for happy rewards or participate in BENT staking or CVX staking. CVX staking will be used to vote on the Convex Gauge and controlled by the BENT stakers. Fun right? The end result here is by staking your Curve LP or CVX into BENT instead of Convex you will yield more and this allows BENT stakers to effectively get a piece to control the Curve Gauge vote in a practical manner."

"For the 17% slash on Convex rewards, it is pretty simple, 10% goes to the CVX stakers (got to keep them fat and happy) 6% to the BENT stakers and 1% to the harvester. So the entire system is a decentralized perpetual flywheel."


The Reality

In December alone, several crypto companies, including Grim Finance, BitMart, and AscendEX, collectively lost over $600 million to hacks[13].


"Bent Finance contracts were deployed without multisig wallet contract ownership."

"[T]he BENT Team consists of numerous full time core team members including swisshed, ape, santonicle and conrad plus a few others in support roles. Also the CTO had employed a “dev” on various projects for some time. This dev had worked with him for sometime in a support role. Well, as it happens, sir dev was shared the private keys to the deployer, in order to do the updates and during this time, dev slipped in the exploit."


"As the Bent Finance dev team ramped up security processes by migrating contract ownership to multisig wallets, there was a brief timeframe when a rogue dev had the opportunity to inject an exploit on 2 pools. This happened 3 days before multisig wallets were in place and, therefore, the dev would never have the opportunity again."

What Happened

"In December 2021, Bent Finance was the victim of an internal attack. A rogue developer inserted a backdoor into the contract that later allowed them to extract 513k cvxcrv LP tokens from it." "Bent Finance first realized [an] exploit on Monday[, December 20th] at roughly 8:55 pm EST, a timeline when the company reported no loss of funds."

Key Event Timeline - Bent Finance Malicious Balance Injection
Date Event Description
December 20th, 2023 6:55:00 PM MST "Bent Finance first realized [an] exploit on Monday[, December 20th] at roughly 8:55 pm EST, a timeline when the company reported no loss of funds."
December 21st, 2021 2:51:05 AM MST CoinCu News Article A CoinCu News article reports that Bent Finance, a staking and farming platform, has become the sixth crypto platform to be hacked in December. After confirming the attack, users were advised to withdraw their funds and disable reward requirements on the affected platform[13]. The article discussed the source and timeline of the attack, and the resulting market price, and compares with other events in December. Investigations are reportedly ongoing to assess the extent of the damage caused to Bent Finance.
December 22nd, 2021 2:04:00 AM MST Santa Hackathon Article Cryptonews includes the Bent Finance case in their hackathon article[14].

Technical Details

"In December 2021, Bent Finance was the victim of an internal attack. A rogue developer inserted a backdoor into the contract that later allowed them to extract 513k cvxcrv LP tokens from it."


"What happened was that a few days ago BENT went live on debank and in that, community members were able to see the amount of “deposits” of various tokens. This showed one wallet with a balance of over half a billion dollars of CVXCRV and nearly the same MIM. This balance wasn’t real, but it “fooled” the contract that effectively allowed them to withdraw other peoples tokens until the pool was drained."


"[A]ccording to Joe McGill - the founder of a digital currency risk and advisory company CyChain, and former cyber and cryptocurrency investigator at US Secret Service - an attacker has been funnelling approximately 440 ethereum (ETH) (USD 1.78m) since December 12 after they had "funded one of the primary wallets via TornadoCash cash deposits" on December 9."


"Most recently, the Bent Finance team said that there was an exploit from the bent deployer address, which added various amounts of Convex CRV (cvxCRV) and Magic Internet Money (MIM) to "an address on an unverified update 20 days ago.""


"[T]he BENT Team consists of numerous full time core team members including swisshed, ape, santonicle and conrad plus a few others in support roles. Also the CTO had employed a “dev” on various projects for some time. This dev had worked with him for sometime in a support role. Well, as it happens, sir dev was shared the private keys to the deployer, in order to do the updates and during this time, dev slipped in the exploit."

"The attacker targeted Bent Finance’s cvxcrv and mim pools and performed a series of updates to the contracts. The goals of these updates were to hardcode a balance for a particular account via a backdoor and then conceal this modification by updating the contract with a non-backdoored version after the balance had been updated."


"In the process of burning the proxy and tightening security (kek) “someone” had slipped an unverified contract update in before updating to the next verified contract. This update hardcoded half a billion dollars in deposits they didn’t actually own, allowing them in the future to drain the pools whenever they liked."


"As the Bent Finance dev team ramped up security processes by migrating contract ownership to multisig wallets, there was a brief timeframe when a rogue dev had the opportunity to inject an exploit on 2 pools. This happened 3 days before multisig wallets were in place and, therefore, the dev would never have the opportunity again."


"The attacker’s modifications to the code assigned a balance of 100000001000001 * 10^12 to address 0xd23cfffa066f81c7640e3f0dc8bb2958f7686d1f. Once the contract’s balances were updated, replacing the backdoored code with a clean version has no impact on this balance. This allowed the attacker to later withdraw this liquidity from the cvxcrv pool, draining it."


"“We came to the same conclusion and are working on it,” said Bent Finance as the team appointed two independent white hat developers to better understand the current situation. The company confirmed shortly thereafter:

“Twenty days ago there was an exploit from the developer address Bent that added cvxcrv and mim balances to an address in an unverified update. We only discovered that today. There are many members of this group and we will take appropriate action.”

"Bent Finance continues to advise its pool investors to withdraw funds until mining is fully completed. However, the company has confirmed it will get back any funds stolen from the Bent pool."

Total Amount Lost

"In December 2021, Bent Finance was the victim of an internal attack. A rogue developer inserted a backdoor into the contract that later allowed them to extract 513k cvxcrv LP tokens from it."

"As of now the 513k cvxcrv LP has been stolen , we are working to recover this directly from the rogue dev,"

The total amount lost has been estimated at $1,780,000 USD.

Immediate Reactions

Initially, Bent Finance identified a mining attack but reported no financial loss. However, suspicions of a rug pull arose when blockchain investigator PeckShield traced the source of the hack transactions. The company acknowledged this and appointed two independent white hat developers to assess the situation.[13]

It was discovered that an exploit occurred twenty days earlier when funds were added to an unverified address from the developer's account. Bent Finance urged its pool investors to withdraw their funds until the mining process was complete. The company also committed to recovering any stolen funds from the Bent pool.[13]


"Bent Finance first realized [an] exploit on Monday[, December 20th] at roughly 8:55 pm EST, a timeline when the company reported no loss of funds."


"There is a possible exploit. [W]e have disabled claims, you will not be able to claim rewards at the moment. [W]e are investigating the curve LP pools, if you want to be safu, you can withdraw it now. We will update you as soon as we know more, as of now, no funds have been lost."


"However, the community suspected a rug-pull event when blockchain investigator PeckShield allegedly located the source of the hack transactions."


"There was an exploit from the bent deployer address, it added balance of cvxcrv and mim to an address on an unvierifed update 20 days ago. We just discovered this today. There are multiple members on this team and we will make this right." "We recommend you withdraw all funds until it is clear."

Token Market Price Impact

As a result of the attack, the price of the native BENT token plummeted, declining by 74% from its all-time high of $15.9 on December 19, 2021, to $4.12. It is reported that attackers stole approximately 440 Ethereum, valued at over $1.6 million at the time of the investigation.[13]


"The BENT coin dropped more than 70% in a single day." "The price of the native BENT token has plummeted since the attack was announced and is still 73% in the red on that day. The token is currently trading at $ 4.12, down 74% from the all-time high of $ 15.9 set on December 19, 2021."


"“We came to the same conclusion and are working on it,” said Bent Finance as the team appointed two independent white hat developers to better understand the current situation. The company confirmed shortly thereafter:

“Twenty days ago there was an exploit from the developer address Bent that added cvxcrv and mim balances to an address in an unverified update. We only discovered that today. There are many members of this group and we will take appropriate action.”


Ultimate Outcome

"Bent Finance continues to advise its pool investors to withdraw funds until mining is fully completed. However, the company has confirmed it will get back any funds stolen from the Bent pool."

"Rouge dev has been passed on to relevant authorities as the investigation continues." "As of now the 513k cvxcrv LP has been stolen , we are working to recover this directly from the rogue dev, if we are unable, we will institute a plan for community recovery. If you have been effected , please get in contact with @swishedd in the discord or telegram."

"What happened next was a few days of “interesting things” but we can say that the exploiter agreed to return the funds to the multisig at 0xaBb8B277F49de499b902A1E09A2aCA727595b544."


"Now since he dumped the curve at the bottom and it has been pumped since, and sent us ETH and DAI, we came a little short, but have worked it out.To date, we have raised an additional 200,000 cvxcrv ~ ($1M) from the community to help plug the gap. Also you can see what we did to patch access so nothing like this can happen again here."


Total Amount Recovered

"Now since he dumped the curve at the bottom and it has been pumped since, and sent us ETH and DAI, we came a little short, but have worked it out.To date, we have raised an additional 200,000 cvxcrv ~ ($1M) from the community to help plug the gap. Also you can see what we did to patch access so nothing like this can happen again here."

[As of December 24th,] "[w]e have recovered lost funds from the exploit and made it right." "You can see the reimbursement of lost funds for 512,696.06482288612 cvxcrv-f paid in full."

Ongoing Developments

TBD

Individual Prevention Policies

Bent Finance was prepared by anonymous developers and the final smart contract was unaudited.

Avoid the use of smart contracts unless necessary. Minimize the level of exposure by removing or withdrawing assets whenever possible. Aim to choose smart contracts which have obtained third party security audits, preferably having been audited by at least three separate reputable firms. Pay attention to the audit reports, which smart contracts are covered, and whether the smart contract has been upgraded or modified since the report. Ensure that any administrative functions with the ability to remove funds from the smart contract are under the authority of a multi-signature wallet which is controlled by at least three separate and reputable entities.

Store the majority of funds offline. By offline, it means that the private key and/or seed phrase is exclusively held by you and not connected to any networked device. Examples of offline storage include paper wallets (seed phrase or key written down and deleted from all electronic media), hardware wallets, steel wallet devices, etc...

For the full list of how to protect your funds as an individual, check our Prevention Policies for Individuals guide.

Platform Prevention Policies

Bent Finance was prepared by anonymous developers and the final smart contract was unaudited. Audits need to be performed after the smart contract is fully deployed, and should include an investigation of the balances which are present. A multi-signature needs to be used for all critical components at all times.

All wallets, minting functions, and critical infrastructure should be implemented with a multi-signature requirement, with a recommended minimum of 3 signatures required. This means that making important changes or approving spending will require the keys held by at least 3 separate individuals within the organization to approve. The multi-signature should be implemented at the lowest layer possible, all key holders should have security training, and all key holders should be empowered and encouraged to exercise diligence.

All aspects of any platform should undergo a regular validation/inspection by experts. This validation should include a security audit of any smart contracts, reporting any risks to the backing (of any customer assets, ensuring treasuries or minting functions are properly secured under the control of a multi-signature wallet, and finding any inadequacies in the level of training or integrity of the team. The recommended interval is twice prior to launch or significant system upgrade, once after 3 months, and every 6 months thereafter. It is recommended that the third party performing the inspection not be repeated within a 14 month period.

Work with other industry platforms to set up a multi-signature wallet with private keys held separately by delegate signatories from seven prominent platforms and services within the industry. Establish requirements for contributions by all platforms and services, designed to be affordable for small platforms yet large enough to cover anticipated breach events. Any breach event can be brought forth by a member platform or a petition of 100 signatures for consideration by the delegate signatories. A vote of 4 or more delegate signatures is required to release any funds, which could partially or fully restore lost funds based on their assessment.

For the full list of how to protect your funds as a financial service, check our Prevention Policies for Platforms guide.

Regulatory Prevention Policies

Bent Finance was prepared by anonymous developers and the final smart contract was unaudited. Audits need to be performed after the smart contract is fully deployed, and should include an investigation of the balances which are present. A multi-signature needs to be used for all critical components at all times.

All platforms should undergo published security and risk assessments by independent third parties. Two assessments are required at founding or major upgrade, one after 3 months, and one every 6 months thereafter. The third parties must not repeat within the past 14 months. A risk assessment needs to include what assets back customer deposits and the risk of default from any third parties being lent to. The security assessment must include ensuring a proper multi-signature wallet, and that all signatories are properly trained. Assessments must be performed on social media, databases, and DNS security.

Create a standard tutorial and quiz for all new cryptocurrency participants, which is required to be completed once per participant. This tutorial and quiz should cover the basics of proper seed phrase protection, strong password generation, secure two-factor authentication, common fraud schemes, how to detect and guard against phishing attacks, how ponzi schemes work, as well as other risks which are unique to the cryptocurrency space.

Set up a multi-signature wallet with private keys held separately by delegate signatories from seven prominent platforms and services within the industry. Establish requirements for contributions by all platforms and services within the country, designed to be affordable for small platforms yet large enough to cover anticipated breach events. Any breach event can be brought forth by a member platform or a petition of 100 signatures for consideration by the delegate signatories. A vote of 4 or more delegate signatures is required to release any funds, which could partially or fully restore lost funds based on their assessment.

For the full list of regulatory policies that can prevent loss, check our Prevention Policies for Regulators guide.

References