Beanstalk cryptocurrency project robbed after hackers voted to send themselves

Beanstalk cryptocurrency project robbed after hackers voted to send themselves $182 million

On Sunday, an attacker managed to withdraw around $182 million in cryptocurrency from Beanstalk Farms, a decentralized finance (DeFi) project that aims to balance supply and demand of various cryptocurrency assets. Specifically, the attack exploited Beanstalk’s majority voting governance system, a core feature of many DeFi protocols.

The attack was spotted on Sunday morning by blockchain analytics firm PeckShield, which estimated the net profit for the hacker to be around $80 million of the total funds stolen minus some of the borrowed funds needed to carry out the attack.

Beanstalk admitted the attack in a tweet shortly afterand said they are “investigating the attack and will make an announcement to the community as soon as possible.”

“We’re seeing an increasing trend of flash loan attacks this year”

Beanstalk describes itself as a “decentralized credit-based stablecoin protocol.” It operates a system where participants earn rewards by depositing funds into a central funding pool (called “the silo”), which is used to balance the value of a token (known as a “bean”) to nearly $1.

Like many other DeFi projects, the creators of Beanstalk – a development team called Publius – integrated a governance mechanism where participants could collectively vote on changes to the code. They would then be granted voting rights in proportion to the value of the tokens they held, creating a vulnerability that would prove fatal to the project.

The attack was enabled by another DeFi product called “flash loans,” which allows users to borrow large amounts of cryptocurrency for very short periods of time (minutes or even seconds). Flash loans are designed to provide liquidity or take advantage of price arbitrage opportunities, but can also be used for more nefarious purposes.

“Developers and admins should be aware of new bugs that may be created by developers or DAO members.”

According to an analysis by blockchain security firm CertiK, the Beanstalk attacker used a flash loan obtained via the decentralized protocol Aave to borrow nearly $1 billion in cryptocurrency assets, trading them for enough beans to gain a 67% voting stake percent of the project. With that controlling interest, they were able to authorize the execution of code that transferred the assets to their own wallet. The attacker then immediately repaid the flash loan and made a profit of $80 million.

Based on the term of an Aave Blitzkredit, the entire process took less than 13 seconds.

“We’re seeing an increasing trend in flash loan attacks this year,” said Ronghui Gu, CEO and co-founder of CertiK. “These attacks underscore the importance of a security audit and educating on the pitfalls of security issues when writing Web3 code.”

When properly implemented, DeFi services benefit from the overall security of the blockchain, but their complexity can make full code inspection difficult, making such projects an attractive target for hackers. In the case of the Beanstalk hack, the Publius team admitted that they hadn’t taken any precautions to mitigate the possibility of a Flash Loan attack, although this was presumably not apparent until the situation arose.

A request for comment (sent to the Publius team via Discord) has not received a response as of press time.

Brian Pasfield, CTO of cryptocurrency lending platform Fringe Finance, said decentralized governance structures (known as DAOs) could also cause problems.

“DAO governance is trending in DeFi right now,” Pasfield said. “While this is a necessary step in the decentralization process, it should be done gradually and with careful consideration of all potential risks. Developers and admins should be aware of new bugs that may be intentionally or accidentally created by developers or DAO members.”

There may be little recourse for Beanstalk investors who have lost their staked coins. In a message released immediately after the hack, the Beanstalk founders wrote that it was “highly unlikely” that the project would receive a bailout as it was not developed with VC support, adding: ” We’re screwed.”

On the project’s Discord server, many users claim to have lost tens of thousands of dollars in invested cryptocurrency. Since the attack is the hacker Moving funds through Tornado Cash, a privacy-focused mixer service that has become an indispensable step in laundering stolen cryptocurrency funds. With much of the stolen money now hidden, it is unlikely to be tracked down and returned.

As a result of the attack, the BEAN stablecoin has fallen in value, breaking through the $1 peg and trading for around 14 cents as of Monday afternoon.