Why DeFi Hacks Keep Happening After Audits
Why do DeFi hacks keep happening even after audits? Explore the hidden vulnerabilities, smart contract risks, and security gaps that audits may fail to catch.
A smart contract audit reviews a specific version of a protocol’s code, at a specific moment in time, against a specific set of known vulnerability patterns. It does not, and cannot, guarantee that every future update to that code will be equally safe, that no deployment configuration mistake will slip through, or that no entirely new attack technique will emerge later. Two of DeFi’s largest hacks, Euler Finance’s $197 million loss in March 2023 and Nomad Bridge’s $190 million loss in August 2022, both happened to protocols that had already been audited, and in Euler’s case, the exact flawed code had itself been sent to an outside auditor before it went live.
This is the gap most consumer coverage of “audited” protocols glosses over. An audit lowers risk. It does not remove it, and understanding exactly where its coverage ends is the difference between informed DeFi use and a false sense of security.
Key Facts
| Incident | Detail | Source |
|---|---|---|
| Euler Finance exploit | $197 million drained on March 13, 2023, through a function added in a later patch that skipped a solvency check present in every other fund-moving function | Veridise, “Insolvency Vulnerability: The Euler Finance $197M Exploit” |
| The patch itself was audited | The vulnerable donateToReserves function was written to patch an earlier, smaller bug, and that patch was sent to Euler’s most recent auditor for review before deployment | Euler Labs, official post-mortem |
| Auditor’s insurance payout | Sherlock, the audit and coverage firm that reviewed the relevant code, paid Euler a $4.5 million claim for missing the vulnerability | CryptoRank, reporting on Sherlock’s response |
| Nomad Bridge exploit | $190 million drained on August 1-2, 2022, after a routine contract upgrade mistakenly marked an empty value as a “trusted root,” letting any message pass verification | TRM Labs, incident summary |
| Why the flaw was hard to catch | Auditing firm CertiK stated the bug “would be difficult to discover under conventional auditing practices,” since it stemmed from a deployment configuration error rather than the contract code itself | CryptoNews, citing CertiK’s incident report |
| Scale of the copycat effect | Once the flaw became public, roughly 88% of the addresses that drained funds were “copycats” who copied the original exploit’s code, not the original attacker | Coinbase research, cited via Yahoo/CoinDesk |
TL;DR
- An audit certifies a specific snapshot of code, not the protocol forever. Any change made after the audit, including a small patch, falls outside its coverage unless separately reviewed.
- Euler Finance’s $197 million exploit came from a function written specifically to patch an earlier bug, sent to audit, and still missed, showing that even audited patches can fail.
- Nomad Bridge’s $190 million exploit came from a deployment configuration mistake during a routine upgrade, a category of error the auditing firm CertiK itself said conventional audits struggle to catch.
- DeFi’s public, permissionless nature means once one attacker finds and executes an exploit, others can often copy the exact technique within minutes, turning a single vulnerability into a mass-participation event, as happened with Nomad.
- Both protocols recovered meaningful funds after the fact through negotiation and bounty programs, but recovery is neither guaranteed nor fast, and depends heavily on attacker cooperation that isn’t something users can rely on in advance.
What an Audit Actually Promises
A smart contract audit typically involves a security firm manually and programmatically reviewing a protocol’s code for known categories of vulnerabilities: reentrancy bugs, integer overflow errors, access control mistakes, and similar patterns that have caused past exploits. Reputable audits genuinely reduce risk, and protocols that skip them entirely are considerably more dangerous on average.
What an audit does not do is certify the protocol’s entire future. It reviews the code as submitted, at that moment, and its findings apply to that specific version. Once a protocol ships a new feature, patches a bug, or changes a deployment parameter, that new code exists outside the original audit’s scope until, and unless, it goes through review again. Both of the incidents below happened because of exactly this gap.
Euler Finance: When the Patch Itself Was the Problem
Euler Finance was a non-custodial lending protocol that had been reviewed by outside auditors multiple times, including reviews by Sherlock in December 2021, January 2022, and July 2022. According to Euler Labs’ own detailed post-mortem, a white hat researcher had separately flagged a smaller, lower-severity bug affecting how new, uninitialized lending pools handled their first deposits. To fix it, Euler’s team wrote a new function called donateToReserves, intended to let a user donate part of their own balance to the protocol’s reserves, and sent that fix to their auditor for review before deploying it.
The new function had a critical gap: unlike every other function in the protocol that moved a user’s balance, it never checked whether the user remained solvent after the donation. That let an attacker deliberately push their own account into insolvency, then exploit Euler’s liquidation mechanism to extract far more value than they had put in. On March 13, 2023, an attacker used this flaw across a chain of flash-loan transactions to drain roughly $197 million. Sherlock later paid Euler a $4.5 million insurance claim for having missed the vulnerability during its review.
What makes this case so directly relevant to the “why do audits fail” question is that the flaw wasn’t in unreviewed code. It was in a patch that had gone through the audit process specifically because the team wanted extra scrutiny, and it still slipped through. Several weeks later, the attacker, who identified themselves only as “Jacob,” returned effectively all of the stolen funds, ultimately totaling around $240 million with appreciation, after a negotiation process, an outcome that is far from guaranteed in cases like this.
Nomad Bridge: When the Deployment Itself Was the Bug
Nomad operated a cross-chain bridge, software that lets users move assets between different blockchains. On August 1, 2022, a routine upgrade to one of Nomad’s contracts mistakenly initialized a security value, the “trusted root” used to verify incoming messages, as zero instead of a genuine cryptographic value. That misconfiguration meant the contract would accept any message as automatically “proven” valid, regardless of whether it actually was.
CertiK’s incident report on the exploit made a point worth taking seriously: this class of bug, caused by a deployment configuration mistake rather than a flaw in the contract’s written logic, is genuinely harder for a conventional line-by-line code audit to catch, since the code itself could be perfectly correct while the values used to initialize it in production are wrong. Once a single attacker discovered the flaw, the exploit required no special technical skill to repeat: it simply meant copying the winning transaction’s format, swapping in a new wallet address, and resubmitting it. Coinbase’s own research into the incident found that roughly 88% of the addresses that drained funds from Nomad were copycats who reused someone else’s exploit code rather than independent hackers, turning what began as one person’s discovery into what researchers described as one of the most chaotic hacks in DeFi’s history.
Why DeFi’s Structure Makes This Pattern Worse Than It Would Be Elsewhere
Both cases point to a feature of decentralized finance that has no real equivalent in traditional software security. DeFi protocols are open by design: their code is usually public, their transactions are visible on-chain in real time, and there’s no central operator who can quietly patch a live exploit before word gets out. That transparency is core to what makes DeFi auditable and trustworthy in the first place, but it also means that once a working exploit exists, anyone technically capable of reading a blockchain explorer can potentially replicate it, exactly what happened with Nomad’s copycats.
Comparison: Two Different Ways Audits Get Bypassed
| Euler Finance | Nomad Bridge | |
|---|---|---|
| Was the vulnerable code audited | Yes, the specific patch was reviewed before deployment | No; the flaw came from deployment configuration, not reviewed source code |
| Type of failure | A missing solvency check in new logic | A misconfigured value during contract initialization |
| Number of exploiters | One primary attacker | One original attacker, followed by hundreds of copycats |
| Outcome | Nearly all funds returned after negotiation | Some funds returned by self-identified white hats; recovery partial |
| Lesson for the “audits fail” question | Even audited code can miss logic errors auditors didn’t anticipate | Deployment and configuration risk often falls outside an audit’s practical scope entirely |
What Users Actually Lose, and Who Absorbs It
When a DeFi protocol is exploited, the funds at risk are typically user deposits, not just the protocol’s own treasury, since most DeFi lending and liquidity products pool user funds directly. Unlike a centralized exchange collapse, there’s usually no company balance sheet or executive to pursue afterward, and recovery, when it happens, generally depends entirely on the attacker’s willingness to negotiate, as both Euler and Nomad experienced to different degrees. Auditors face reputational and, as Sherlock’s case shows, sometimes direct financial consequences, but the initial loss and the uncertainty during recovery negotiations fall on the users whose deposits were exposed.
Practical Guidance
- Treat “audited” as a risk-reduction signal, not a safety guarantee, and check whether a protocol’s most recent code changes, not just its original launch, went through review.
- Be especially cautious around recently patched or upgraded protocols, since new code by definition has had less real-world scrutiny than code that has run unchanged for a long period.
- Understand that recovering funds after a DeFi exploit typically depends on negotiating with the attacker rather than any formal legal or insurance process, and that outcome is never guaranteed in advance.
- Diversify exposure across protocols rather than concentrating meaningful funds in a single lending or liquidity product, regardless of its audit history.
- Follow security researchers and protocols’ own incident disclosures directly rather than relying solely on a protocol’s marketing claims about its audit history.
What Happens Next
Expect the industry to keep layering additional safeguards, bug bounty programs, ongoing audits rather than one-time reviews, and on-chain monitoring tools, on top of traditional audits, precisely because both the Euler and Nomad cases showed the limits of a single point-in-time review. Neither case suggests audits are worthless; both protocols had them, and both still lost meaningful information about their own risk surface in the process. The realistic expectation going forward is that audits will keep reducing, without eliminating, the frequency of this kind of loss, and that deployment and configuration risk will remain a persistent, less-visible category that formal code review alone doesn’t fully address.
FAQs
If a DeFi protocol is audited, does that mean it’s safe to use? An audit reduces risk but does not eliminate it. It reviews a specific version of the code at a specific time, and both the Euler and Nomad cases show that later patches, upgrades, or deployment mistakes can introduce new vulnerabilities outside that original review’s scope.
How did the Euler Finance exploit happen if the code had been audited? The vulnerable function was part of a later patch that was sent to an auditor before deployment, but the auditor missed a missing solvency check that the exploit relied on.
Why were so many different people involved in draining the Nomad Bridge? Once the first attacker found the flaw, the exploit required copying a transaction format and changing a wallet address, something Coinbase’s research found roughly 88% of the exploiters did rather than discovering the bug independently.
Do DeFi users typically get their money back after a hack like this? Sometimes, but never guaranteed. Both Euler and Nomad recovered significant funds through negotiation with attackers and white-hat cooperation, but this outcome depends on factors users have no control over.
Sources
- Veridise, “Insolvency Vulnerability: The Euler Finance $197M Exploit”
- Euler Labs, “War & Peace: Behind the Scenes of Euler’s $240M Exploit Recovery”
- CryptoRank, “Euler Finance gives an important update to users on the $197m hack”
- TRM Labs, “Key Suspect in $190M Nomad Bridge Exploit Extradited to the United States”
- CryptoNews, “Cross-Chain Bridge Nomad Loses $190 Million,” citing CertiK’s incident report
- Coinbase research on Nomad “copycat” exploiters, via Yahoo Finance
This article is for educational purposes and does not constitute financial or legal advice. Decentralized finance protocols, including audited ones, carry risk of partial or total loss of funds. If you are making decisions about participating in DeFi protocols, consider consulting a licensed financial advisor.
-
Altcoins2 months agoWhat They Never Told You About the Security of Cryptocurrencies
-
Bitcoin2 months agoBlackRock’s BITA Bitcoin ETF Shows Wall Street Is Repackaging Bitcoin for Income Investors
-
Crypto Safety4 days agoWhy KYC Does Not Mean Your Funds Are Protected
-
Editor's Choice2 months agoHow Federal Reserves Rate Hold Affects Global Economy
-
Altcoins2 months agoKraken Eyes Aave Stake as DeFi’s Next Battle Moves to Credit and Collateral
-
Bitcoin2 months agoWhy Bitcoin Moves With the Fed, When It Claims to Be Independent
-
Breaking News1 month agoMiCA Migration Puts EU Crypto Firms on High Alert as AMLA Warns of Financial Crime Risks
-
Altcoins2 months agoZama, Morpho and Steakhouse Bring Confidential DeFi to Ethereum
