Skip to main content
Block #9

Moonwell Exploit Highlights Risks of AI in Decentralised Finance

Crypto News

Moonwell Exploit Highlights Risks of AI in Decentralised Finance

Amina El Yazidi
moonwell exploit onderstreept risicos van ai in gedecentraliseerde financien
3 min

Moonwell, a decentralised finance (DeFi) protocol deployed on Base and Optimism, recently suffered an exploit resulting in a loss of approximately $1.78 million. This occurred after a price oracle for Coinbase Wrapped Staked ETH (cbETH) reported a value of approximately $1.12 instead of the correct value of roughly $2,200. This mispricing provided attackers with an opportunity to exploit the system for their own gain.

According to a post-mortem from Moonwell, a governance proposal executed on a Sunday misconfigured the cbETH oracle by using only the cbETH/ETH exchange rate. This led to the incorrect reporting of cbETH at approximately $1.12. Liquidation bots and opportunistic borrowers eagerly capitalised on this pricing error, resulting in bad debt of approximately $1.78 million.

The affected contracts feature several adjustments co-authored by Anthropic's Claude Opus 4.6. This has raised concerns from security auditor Pashov, who publicly cited the incident as an example of how artificial intelligence-generated or AI-assisted Solidity code can fail.

Despite this warning from Pashov, it is crucial not to view this error solely as an AI-driven problem. He emphasised that such errors could just as easily have been made by an experienced Solidity developer. The core issue proved to be a lack of sufficiently rigorous checks and end-to-end validation.

Although the dollar amount of the exploit is relatively small compared to other major incidents within DeFi, such as the Ronin bridge exploit in March 2022 where over $600 million was stolen, the combination of AI co-authorship and a simple price configuration error on a major asset is what makes the Moonwell case notable. This raises urgent questions regarding the governance and control systems within such protocols.

Despite this warning from Pashov, it is crucial not to view this error solely as an AI-driven problem.

Pashov reported that his own firm would not fundamentally change its processes, but that they would be vigilant regarding code that appears “vibe coded.” This implies they would be extra cautious in identifying potential errors, though he admitted that this specific oracle bug was not easy to detect.

The distinction between clumsy use of AI and professional use is crucial. On one hand, there are non-technical founders who use AI to generate code they cannot verify themselves; on the other, experienced developers possess the ability to use AI to accelerate restructuring, pattern exploration, and testing within a mature engineering process.

AI-assisted development can be valuable, especially in the minimum viable product (MVP) phase, but should certainly not be considered a shortcut to production-ready infrastructure—especially in capital-intensive systems like DeFi. Edwards emphasised that all AI-generated smart contract code should be treated as untrusted input. This requires strict version control, clear code ownership, peer reviews by multiple individuals, and extensive testing, particularly in high-risk areas such as access controls, oracles, pricing logic, and upgrade mechanisms.

Ultimately, responsible use of AI revolves around governance and discipline, with clear assessment gates, a separation between code generation and validation, and the assumption that any contract deployed in a hostile environment may contain latent risks.

3 questions

Q&A

The questions from this article, neatly compiled.

The exploit illustrates that the combination of AI-assisted development and low governance standards can be dangerous. It is crucial that DeFi projects implement rigorous checks and quality assurance, especially when dealing with price oracles.

  • AI
  • defi
  • moonwell
Amina El Yazidi

Written by

Amina El Yazidi

Tax Editor · Brussels (BE)

Expertise

TaxesComplianceLegislation

Amina follows tax rules around crypto in the Netherlands and Belgium. She translates fiscal legal texts into practical steps for retail investors.

Stay in the loop

Follow Block #9.

By 7 a.m. you already know

Every Monday, Wednesday, Friday and Sunday morning at 07:00, the overview in your inbox.

Free. Unsubscribe in one click.

Practice without real money or test your knowledge?

Read more

Other interesting articles

All articles
Block Notes

By 7 a.m. you already know

Monday, Wednesday and Friday the news that matters. Sunday morning the whole week in one overview. No hype, no noise.

  • Monday, Wednesday, Friday and Sunday morning at 07:00
  • 2 min
  • No spam

Free. Unsubscribe in one click.