Exploit

An exploit is an attack that uses a bug in the code of a smart contract, protocol or program to drain other people's funds without knowing anyone's keys. In DeFi, whole protocols and their depositors lose money this way.

How It Works

A smart contract does exactly what its code says, not what its authors intended. If the logic has a hole, anyone who finds it can call the contract in a way that makes it hand over the coins itself. Typical tricks include reentrancy, where the contract pays out several times before it updates the balance; price manipulation through an oracle; and mistakes in access checks. Attacks are often funded with a flash loan: the attacker borrows a huge sum, does everything in a single transaction and repays the debt at once.

Exploit vs. Hack

In an ordinary hack, keys are stolen: a developer's computer is infected, a seed phrase is phished, an exchange server is breached. An exploit technically breaks nothing — it uses what the code allows. That is why attackers sometimes call it an “aggressive arbitrage strategy” and offer to return part of the money in exchange for a bounty. For victims the difference is small: funds leave within minutes, and blockchain transfers cannot be reversed. A historical example: in 2016 a bug in one of the first large investment funds on Ethereum let an attacker drain about a third of its money, and the network carried out a fork, after which Ethereum Classic appeared.

What It Means for an Investor

If you keep coins in a liquidity pool, a lending protocol or a bridge, an exploit can wipe out your deposit even though you did nothing wrong. Cross-chain bridges are attacked especially often because their contracts hold large sums. After an attack the protocol's token usually falls sharply, and wrapped tokens backed by the stolen assets lose their peg. Compensation depends only on the team's goodwill and reserves; there are no guarantees. Mind the knock-on effects too: if the protocol holding your money is itself invested in another one, a hole in someone else's code hits you as well.

Reducing the Risk

A code audit lowers the risk but does not remove it: holes have been found in audited contracts too. Look at how long a protocol has run without incidents and how much money it holds — a long record with a large balance says more than an audit. Do not keep everything in one protocol or on one network. Revoke token spending approvals you no longer need: if a contract you gave an unlimited approval to is exploited, tokens can be pulled straight from your wallet through it. A yield far above the market is often paid for with higher code risk.

Example

An investor put a notional 3,000 USDT into a lending protocol at 12% a year. An attacker took a flash loan, inflated the price of his collateral token for a minute in the pool the protocol used for quotes, and borrowed almost all of the depositors' money against it. By morning the investor's share was worth a notional 200 USDT, and the team promised to cover only 40% of the losses from its reserve.

Related terms

Smart ContractDeFiCross-Chain BridgeBlockchain OracleSmart contract auditRug Pull

On the site

Coin categoriesNew coinsMarket makers

This article was written by AI. Check specific rates, taxes and broker terms with primary sources.

↑ Top