$160M At Risk Due to Bug in DeFi Lending Protocol Compound
Editor's note: This article has been updated with comments from Robert Leshner and Banteg. A week ago, Compound founder Robert Leshner called a bug in his lending protocol’s smart contract a “moral dilemma.” Perhaps for...
Archive context
Older archive item. Useful for background and entity history, but not a fresh market-moving signal.
Editor's note: This article has been updated with comments from Robert Leshner and Banteg.
A week ago, Compound founder Robert Leshner called a bug in his lending protocol’s smart contract a “moral dilemma.” Perhaps for some, but for others today the smart contracts became a vending machine full of free cash.
Today, someone exploited a bug in Compound’s Controller contract, which is the part of the protocol that distributes yield farming rewards to users. By calling Compound’s drip() function, they transferred $68 million, or 202,472 COMP, from Compound’s reservoir to its Comptroller.
Since Banteg, a core developer at Yearn.Finance, tweeted about the exploit earlier this afternoon, four major transactions have drained the Comptroller pool of 64,997 COMP, or $21.4 million. One of those transactions withdrew 37,504 COMP, or $12.3 million. Banteg said that only “addresses with the buggy state can drain" and that there are another five addresses that could claim $45m, "emptying the Comptroller."
It appears my estimate was low because of stale data in accruedComp. Four users managed to claim $21.5m so far, so maybe there are more funds at risk. I don't know of a quick way to check all addresses. pic.twitter.com/IOHRby8nni
— banteg (@bantg) October 3, 2021
Last week, following an update called Proposal 062, the Comptroller pool started distributing 280,000 COMP to the wrong people. Leshner asked users to give the funds back and thanked anyone who did.
Anyone who returns COMP to the community is an alien giga-chad; and if a squad of alien giga-chads ever summon me, I will appear https://t.co/EZLb7g91Ew
— Robert Leshner (@rleshner) October 1, 2021
But because of the way Compound's governance is structured, it takes seven days to correct the error.
Anyone can add more COMP to the Comptroller pool by calling drip(), a public function, but nobody had called in weeks.
"When the drip() function was called this morning, it sent the backlog (202,472.5, about two months of COMP since the last time the function was called) into the protocol for distribution to users," tweeted Leshner today.
"The drip issue has been known to Compound and the security researchers for a few days now," Banteg told Decrypt, "but since there was no mitigation, it was decided to keep it under wraps hoping nobody would notice until a patch is out."
Community developers hoped that patches would go live before drip() was called, Leshner tweeted today. Banteg called the exploit “the best-kept secret in DeFi.”
This brings the total COMP at risk to approximately 490k, of which 136k is still in the Comptroller, and 117k has been returned to the community so far (THANK YOU ).
— Robert Leshner (@rleshner) October 3, 2021
Leshner said that the total amount of COMP at risk is now approximately 490,000, or $160 million, "of which 136k is still in the Comptroller, and 117k has been returned to the community so far."
Commenting on Banteg's post, crypto trader Christopher Mooney said, “I’m honestly impressed it took this long with the number of people that knew. Restores my faith in humanity a little, but in the end one of you chose chaotic neutral.”
Leshner tweeted, "Going forward, I'm optimistic about the patches making their way through the governance process, which fix the distribution, and the community members that are working to manage this bug." COMP has fallen by 4.6% in the past 24 hours.
Why this matters
This blockchain story adds another data point to the current market tape and is useful when read alongside nearby source coverage.
Original source
Read on DecryptRelated market context
Audited DeFi protocols lost $885M to attacks that occurred completely outside their audit scopes
In decentralized finance, “audited” is often presented as a verdict on an entire project. In practice, an audit usually covers nam...
XRP Ledger just quietly activated critical foundation for its upcoming new lending protocol
The XRP Ledger activated a package of fixes for transaction handling, AMMs, and newer protocol features, putting outdated servers...
Coinbase gives community banks a stablecoin bridge while supplying infrastructure underneath
Coinbase’s new partnership with payments platform Moov gives community banks and credit unions a route to offer stablecoin service...
Injective Protocol plans major RWA mainnet upgrade
Injective's upgrade enhances regulatory compliance and interoperability, potentially positioning it as a leader in tokenized secur...
Revolut Exposes Bitcoin Records, Passports After Fraudulent Government Email Attack
Key Takeaways: Revolut had to share sensitive data about its users after receiving a phishing request that looked legitimate from...
CLARITY Act Nears Senate Showdown: Crypto’s Long Wait for US Rules Reaches a Critical Vote
For cryptocurrency businesses waiting for Washington to settle how their industry should be regulated, the next hurdle comes down...