DeFi Vault Hack Explained and How to Judge Risk

Compromised keys and operational weaknesses accounted for 56% of reported DeFi losses in a 2026 review covering roughly $840 million stolen across 25 incidents, which also highlighted a $285 million vault-related attack and a $292 million bridge or verifier incident among major losses involving no direct smart-contract flaw (DeFi forensic research review). For a stablecoin depositor, that changes the question: checking the code isn't enough. You also need to understand who controls the vault, which outside systems it trusts, and what happens when those systems fail.

Table of Contents

  • What a DeFi Vault Hack Means for Depositors

    • The code is only part of the boundary

  • How Vault Accounting Breaks Under Attack

    • When the books update too late

    • What a meaningful defense addresses

  • The Main Paths That Drain a Vault

    • Yearn shows why the amounts differ

    • Borrowed capital isn't the only route

  • What Yearn and Euler Taught Depositors

    • A lending function changed the outcome

    • Recovery isn't a feature you can assume

  • What Users Face After the Funds Move

    • A pause changes access, not ownership

    • Read the recovery promise carefully

  • How to Judge a Vault Before You Deposit

    • What to Check Before a Vault Deposit

    • Manual selection or automated allocation

  • What to Do the Next Time a Vault Is Hit

    • Establish what still works

    • Choose based on evidence


What a DeFi Vault Hack Means for Depositors

You deposited stablecoins, received a balance in an app, and later saw the vault described as hacked. Your first question probably isn't which function failed. It's whether your balance still represents assets you can withdraw.

A DeFi vault hack is the unwanted movement or mispricing of pooled assets through smart-contract logic, privileged permissions, or a dependency such as an oracle, bridge, or lending market. The attacker doesn't necessarily steal your wallet password. They may make the vault itself authorize a withdrawal, accept an inflated asset value, or interact with a malicious contract.

That's different from someone accessing an exchange account with stolen credentials. Your wallet can remain uncompromised while the shared pool backing your position loses assets. Likewise, an unchanged balance on a screen doesn't establish that the pool can redeem it.


The code is only part of the boundary

The control plane means the people, keys, and permissions that determine how a vault operates. Who can upgrade its implementation? Who can approve a strategy? Who can pause it, and can that same signer move the funds?

Composability adds another boundary: a vault may depend on contracts it doesn't control. A strategy can hold stablecoins while relying on another market's collateral valuation, liquidation process, or governance decisions.

An audit is evidence about a reviewed implementation, not proof that every authorized action or external dependency is safe.

For depositors, it helps to separate several questions:

  • Ownership: Is the wallet yours, and what permissions have you granted?

  • Backing: What assets support the displayed position?

  • Authority: Which people or contracts can change how those assets are handled?

  • Exit: What conditions could prevent redemption?

These questions complement managing counterparty risk in DeFi. Even without a traditional custodian, you still depend on other actors making decisions and maintaining infrastructure.

The useful distinction isn't hacked versus unhacked. It's whether the accounting is trustworthy, whether privileged access remains controlled, and whether an exit still works. Those answers determine what the incident means for your deposit.


How Vault Accounting Breaks Under Attack

Vault shares represent claims on a pool. In the basic model, depositing assets mints shares, withdrawing burns them, and the share price is the pool's accounted assets divided by outstanding shares. The important word is accounted: a displayed asset value must correspond to assets the vault can realize.

The diagram separates those accounting relationships.

A diagram explaining how vault accounting functions in DeFi, detailing minting, burning, share pricing, and asset claims.


When the books update too late

Think of a cloakroom attendant handing over a coat before crossing the ticket off the collection list. If someone can present the same ticket again during that gap, the records still say they're entitled to collect.

Reentrancy follows that pattern. A vault calls an external token or callback-capable contract before updating its share balances, asset balances, or withdrawal state; the callback lets an attacker enter again while the old accounting remains visible, potentially extracting excess assets or duplicated rewards. Read-only reentrancy extends the problem across contracts: another protocol reads stale valuation data and uses it to price collateral or authorize borrowing, as described in OWASP's reentrancy guidance.

The problem isn't merely that an external call exists. It's that the vault exposes an inconsistent position while another contract can act on it.


What a meaningful defense addresses

Practical controls should target that inconsistency:

  • Update accounting first: Record the withdrawal's effects before handing control to an external contract.

  • Guard sensitive functions: Apply function-level reentrancy protections where callbacks could reopen an operation.

  • Reduce external interactions: Keep deposit and withdrawal paths as narrow as practical.

  • Test callback behavior: Include ERC-777-style tokens, strategy contracts, and integrations that read valuations during execution.

A smart-contract security audit is more useful when you can connect its findings to these specific paths rather than treating its existence as a safety label.

Accounting skepticism also has an off-chain parallel. Kons Law's resource on how to identify manipulated accounting reserves offers context for questioning reported reserves, although it isn't a technical guide to vault security.

These defenses address a known accounting failure. They don't establish that an administrator's key, governance process, or oracle is trustworthy.


The Main Paths That Drain a Vault

An attacker doesn't need to start with enough money to buy a large position. A flash loan can supply temporary, uncollateralized capital that the attacker uses within an exploit sequence before repaying the borrowing.

The simplified flow shows how borrowed capital can support manipulation rather than serve as the underlying vulnerability.

An infographic detailing the four main steps of a DeFi vault exploit involving flash loans and price manipulation.


Yearn shows why the amounts differ

On February 4, 2021, Yearn Finance's yDAI v1 vault suffered approximately $11 million in gross losses, while the attacker realized roughly $2.7–$2.8 million after transaction, liquidity-pool, and lending fees; reported stolen assets included approximately 513,000 DAI, $1.7 million in USDT, and additional CRV, while responders acted within roughly 11 minutes to protect about $24 million remaining in the vault (contemporary reporting on the Yearn exploit).

The attack combined instant borrowing with weaknesses in automated vault accounting and trading logic. The loan shaped the sequence. The exploitable assumptions determined whether that sequence could extract value.

Keep the amounts separate:

  • Vault loss: The value removed from depositors' backing.

  • Attacker profit: What the attacker retained after executing the operation.

  • Execution costs: Value consumed by transactions, liquidity pools, and lending fees.

A smaller attacker profit doesn't imply a smaller depositor loss. Fees aren't automatically returned to the damaged pool.

This video provides an additional visual explainer to accompany the attack sequence.


Borrowed capital isn't the only route

Another path starts with a function that interacts unexpectedly with collateral accounting and liquidation. A third starts with a privileged key that can authorize withdrawals, without needing to manipulate user-facing accounting at all.

For a stablecoin holder, the practical concern is the dependency chain. A vault that lends, swaps, or reads prices elsewhere inherits assumptions from those systems. Holding a stablecoin doesn't make those assumptions conservative.

A useful DeFi smart-contract risk assessment should therefore cover strategy logic, external dependencies, transaction simulation, emergency controls, and deposit or withdrawal pausing. Simulations can test modeled conditions, but they can't establish that every future interaction will behave as expected.

The right question isn't whether flash loans are blocked. It's whether temporary capital, authorized permissions, or an external valuation can make the vault release more value than it should.


What Yearn and Euler Taught Depositors

A timeline graphic showing 2020 Yearn and 2023 Euler incidents and the lessons learned about DeFi vault security.

Two well-known incidents show different halves of the same problem: what a team can still control during an attack, and what depositors cannot control at all.

Yearn's response illustrates the value of containment. Responders can sometimes protect assets that haven't moved yet, the same way a building manager who spots a burst pipe can shut off water to one floor while the rest of the building keeps running. That ability depends entirely on who holds which keys and whether a pause function exists and works. It doesn't follow that every team will detect an exploit quickly enough, or that every contract gives responders a useful intervention.

Euler offers a different lesson. The eventual recovery was remarkable, but the failure itself showed how familiar lending components can interact in an unfamiliar and damaging way.


A lending function changed the outcome

On March 13, 2023, Euler Finance lost approximately $197 million through a flash-loan attack involving donateToReserves and soft liquidation, with drained assets including roughly 86,000 ETH derivatives valued at $134.6 million, 849 WBTC worth $18.6 million, 34 million USDC, and 8.9 million DAI; reported total value locked fell from approximately $264 million to $10 million, and Euler subsequently stated that 100% of stolen funds were recovered following on-chain negotiations (Euler's account of the exploit and recovery).

The attacker manipulated account health through the interaction between reserve donation and liquidation behavior. For a depositor, the lesson isn't that donating reserves is dangerous. It's that one function can change the economic meaning of another, even when each appears understandable in isolation. Think of two safe ingredients producing a reaction only when combined.

An audited, heavily used lending protocol can still fail when a newly introduced capability interacts unexpectedly with collateral and liquidation accounting. Reviewing components separately isn't the same as validating their combined behavior.

The timeline graphic summarizes the different lessons. The Yearn incident discussed here occurred in February 2021.


Recovery isn't a feature you can assume

Euler's return of funds depended on identifiable on-chain movements, negotiation, and pressure on the exploiter. Depositors shouldn't turn that unusual outcome into an expectation about the next incident.

A successful recovery describes what happened afterward. It doesn't make the original exposure acceptable or guarantee another depositor the same ending.

Diversifying across protocols can reduce dependence on a single failure. It can't eliminate smart-contract, oracle, composability, or governance risk, especially where apparently separate vaults share infrastructure.

These are dated historical illustrations, not achieved results for a current allocator or forecasts of future recovery. Their lasting value is in the questions they leave behind: who holds pause and upgrade rights, can anyone reliably value the remaining assets, and what process determines depositors' claims?


What Users Face After the Funds Move

Funds not yet stolen can still be exposed. A vault may hold assets while relying on an unreliable price, an unsafe permission, or a market that has stopped processing exits.

A 2026 report described an oracle retaining pre-exploit prices during the KelpDAO incident, enabling about $190.86 million in borrowing against unbacked collateral before markets froze; it associated the episode with a $13.2 billion decline in DeFi total value locked over 48 hours, largely through withdrawals, and separately described a Base vault incident where malicious use of Safe multisig controls left about $6 million drained and roughly $31.7 million exposed (Dwellir's incident review).

Those categories aren't interchangeable. Confirmed theft measures assets already removed. Residual exposure describes assets that may still be vulnerable. A withdrawal-driven decline in total value locked isn't itself a theft total.


A pause changes access, not ownership

A pause can prevent further damage by blocking an exploitable path. It can also prevent legitimate depositors from leaving. Whether waiting helps depends on what has been paused and whether the underlying vulnerability remains reachable.

Share accounting creates another uncertainty. If an oracle still values impaired collateral at its earlier price, the displayed share price may not represent what depositors can redeem. A wallet can show the same number of shares while the backing available for redemption changes.

Use the circumstances, not the headline, to frame the decision:

  • Consider exiting an accessible exposure: When a dependency failure is confirmed and a verified withdrawal route remains available, evaluate whether leaving reduces your remaining exposure. Don't assume the quoted redemption value will execute unchanged.

  • Respect containment: When withdrawals are paused to block an active attack, repeatedly submitting transactions won't repair the pool. Track the official scope of the pause and the conditions for reopening.

  • Examine the recovery terms: A haircut, compensation vote, or claims process may be discretionary rather than an enforceable entitlement.


Read the recovery promise carefully

Insurance and compensation aren't interchangeable. Look for the governing terms, covered event, exclusions, decision-maker, and claims procedure before treating either as available.

Recovery principle: “Not taken” describes where assets are. It doesn't establish whether they're withdrawable, correctly valued, or protected from the next transaction.

Frozen liquidity, oracle uncertainty, and governance delays can all change what a depositor ultimately recovers. A calm response starts by identifying which uncertainty applies to your position.


How to Judge a Vault Before You Deposit

An audit-only check asks whether someone reviewed the code. A blast-radius check asks what can change, who can change it, and how far a failure can reach.

Privileged access deserves explicit attention: a documented 2025 Infini incident involved approximately $49.5 million in USDC drained after a former developer retained an admin private key and used privileged functions to grant withdrawal authority (Infini retained-access incident record). Correct deposit logic wouldn't resolve that permission failure.


What to Check Before a Vault Deposit

Check

What to look up

Why it matters

Code review

Accounting updates before external calls, review scope, strategy restrictions, unresolved findings

A narrow review or unrestricted strategy surface leaves important behavior unexamined.

Control plane

Upgrade and admin keys, signer concentration, separated pause and fund-movement rights, time delays, role monitoring

A multisig label means little if credentials are concentrated or administrators can silently expand permissions.

Dependency blast radius

Oracle sources, bridge exposure, withdrawal queues, external lending markets

A vault can inherit failures from systems outside its own contracts.

Don't stop at the signer threshold. Ask whether signers use independent controls, whether contributor departures trigger key revocation, and whether someone monitors role changes. Emergency responders should be able to stop new exposure without automatically receiving unrestricted fund-movement authority.

For dependencies, trace the actual path from your deposit to its final position. If a vault can enter an external lending market, identify what collateral and pricing assumptions that market relies on. A withdrawal queue should have understandable conditions, not merely a reassuring label.

A structured protocol safety analysis can organize that comparison. An audited vault can still be unsafe if administrators retain excessive power or nobody watches the surrounding permissions.


Manual selection or automated allocation

Choosing vaults yourself gives you direct responsibility for selection and monitoring. Automation delegates some of that work, but the allocator's approved universe, wallet permissions, and response rules become additional things to inspect.

One option is Yield Seeker's live Vault Agent, which automates USDC allocation across approved lending vaults on Base through user-owned agent wallets; yield is variable, and its current page states a 10% fee on yield, not deposits (Vault Agent's approach to DeFi exposure).

User ownership doesn't remove the risks of an authorized strategy. Rules and simulations have limits, and automated allocation doesn't eliminate smart-contract, oracle, composability, or governance risk. Compare the available controls with the monitoring work you're realistically prepared to do.


What to Do the Next Time a Vault Is Hit

Start by identifying your actual position, not by reacting to a screenshot. Confirm the affected contract and chain through the protocol's primary communication channels, then compare them with your deposit records.


Establish what still works

  • Check operational status: Determine whether deposits, withdrawals, or specific strategies are paused.

  • Check valuation: Look for an explanation of whether reported assets still support the displayed share price.

  • Classify your exposure: Distinguish confirmed loss, trapped but not yet taken assets, and exposure through an affected dependency.

  • Verify any action: Confirm the destination contract and requested permissions before submitting a withdrawal or claim.

Don't chase a transaction promising reimbursement, and don't sign a claim requesting unlimited approval merely because it uses the protocol's branding. Apply your usual crypto security practices more carefully during an incident, not less.


Choose based on evidence

Yearn's containment and Euler's unusual recovery show different possible outcomes, not promises about response speed or repayment. Broader withdrawals can also change prices and available liquidity for vaults that weren't directly targeted.

Write down the admin, oracle, pause, and exit facts for each vault you already use. Record where you'll get verified incident updates and what evidence would make you reduce exposure. Only then decide whether an automated allocator with a visible rule set fits your available monitoring time, remembering that yield remains variable and losses remain possible.

Yield Seeker offers automated USDC allocation through its live Vault Agent for holders who don't want to select every lending vault manually. Visit Yield Seeker to examine its allocation approach and controls, then compare them with the permissions, dependencies, and exit conditions you're willing to accept.