Seigniorage, rebasing, and fractional designs compared, and why every algorithmic peg has failed under real redemption pressure.
An Exploit is an attack that leverages vulnerabilities in smart contracts, protocols, or infrastructure to steal funds, manipulate systems, or gain unauthorized access. In Web3 , exploits often result in immediate, irreversible loss of funds.
Unlike traditional finance where transactions can be reversed, blockchain exploits are typically permanent - once funds are stolen, they're usually gone forever.
Types of Exploits
1. Code Vulnerability Exploits
Reentrancy Attacks
Most famous vulnerability type
Attacker re-enters function before state update
Drains contract repeatedly
Vulnerable Flow:
1. Attacker calls withdraw()
2. Contract sends ETH to attacker
3. Attacker's fallback calls withdraw() again
4. State not yet updated, allows second withdrawal
5. Repeat until drained
Copy link
Famous Example : The DAO hack (2016) - $60M stolen
Integer Overflow/Underflow
Numbers wrap around limits
Balance becomes huge or negative
(Mostly solved in Solidity 0.8.0+)
Access Control Bugs
Missing onlyOwner modifiers
Anyone can call sensitive functions
Mint tokens, drain funds, change admin
2. Economic Exploits
Flash Loan Attacks
Borrow massive amounts (un collateralized)
Manipulate prices/markets
Profit from manipulation
Repay loan in same transaction
Example :
Borrow $100M via flash loan
Manipulate DEX price oracle
Borrow more from protocol using inflated collateral
Repay flash loan
Keep difference
Oracle Manipulation
Exploit price feed dependencies
Inflate/deflate asset prices
Profit from artificial prices
Example : Cream Finance ($130M loss)
Cross-Chain Bridge Vulnerabilities
Bridges hold massive liquidity
Complex multi-chain logic
Verification flaws
Centralized key compromise
Examples :
Ronin Bridge: $625M (2022)
Wormhole: $320M (2022)
Nomad: $190M (2022)
BNB Bridge: $586M (2022)
How It Happens :
Phishing attacks
Social engineering
Insider threat
Weak key generation
Key exposure in code
Examples :
Multiple protocol admins hacked
Twitter hacks promoting scams
5. Rug Pulls
Malicious insiders drain funds:
Abandon project
Remove liquidity
Mint unlimited tokens
Change contract parameters
Example : Thousands of meme coins rug daily
Flash Loan Governance :
Borrow tokens (voting power)
Pass malicious proposal
Execute proposal
Profit
Example : Beanstalk Farms ($182M loss)
Sandwich Attacks :
See large trade in mempool
Buy before (front-run)
User's trade executes (price moves)
Sell after (back-run)
Profit from price movement
Famous Exploits Timeline
Year Protocol Amount Lost Attack Type 2016 The DAO $60M Reentrancy 2020 bZx $8M Flash loan 2020 Harvest Finance $24M Flash loan arbitrage 2021 Poly Network $611M Bridge exploit (returned) 2021 Cream Finance $130M
Total DeFi losses : Billions of dollars
How Exploits Work
Attack Lifecycle
1. Reconnaissance
- Identify target protocol
- Study code/documentation
- Find potential vulnerabilities
2. Weaponization
- Develop exploit code
- Test on testnet/fork
- Prepare attack transactions
3. Delivery
- Execute attack transactions
- Time with market conditions
- Avoid detection
4. Exploitation
- Drain funds
- Manipulate prices
- Extract value
5. Post-Exploitation
- Move funds through mixers
- Convert to privacy coins
- Launder through DEXs
Copy link
Money Laundering Techniques
Attackers hide stolen funds:
Tornado Cash : ETH mixer
Chip mixing : Small amounts across addresses
DEX swaps : Convert to other tokens
Bridge hopping : Move between chains
Privacy coins : XMR, etc.
Common Vulnerability Patterns
1. Unchecked Return Values
// VULNERABLE
(bool success, ) = to.call{value: amount}("");
// Didn't check 'success'!
// SECURE
(bool success, ) = to.call{value: amount}("");
require(success, "Transfer failed");
Copy link
2. Flash Loan Vulnerability
// VULNERABLE - Uses spot price
uint price = oracle.getPrice();
// SECURE - Uses TWAP or multiple sources
uint price = oracle.getTWAP(30 minutes);
Copy link
3. Missing Access Control
// VULNERABLE
function setOwner(address _new) public {
owner = _new;
}
// SECURE
function setOwner(address _new) public onlyOwner {
owner = _new;
}
Copy link
4. Front-Running Vulnerable
// VULNERABLE
function buy() public {
// Transaction visible in mempool
// Can be front-run
}
// SECURE
function buy() public {
// Use commit-reveal scheme
// Or private mempool (Flashbots)
}
Copy link
Protecting Against Exploits
For Protocols
1. Multiple Audits
Use reputable audit firms
Get 2-3 audits minimum
Fix all critical/high issues
2. Bug Bounty Programs
Immunefi, HackerOne
Incentivize white-hat hackers
Ongoing security testing
3. Formal Verification
Mathematical proofs
Certora, etc.
For critical functions
4. Timelocks
Delay admin actions
Community can react
Prevent immediate drain
5. Multi-Signature
Require multiple approvals
Distributed control
Reduce single point of failure
6. Monitoring
Real-time alerts
Anomaly detection
Rapid response
7. Insurance
Protocol coverage
Nexus Mutual, InsurAce
User protection
8. Emergency Controls
Pause functionality
Circuit breakers
Upgrade mechanisms
For Users
1. Due Diligence
Check if protocol audited
Read audit reports
Assess team reputation
| Check TVL and age
2. Diversification
Don't put all funds in one protocol
Spread risk across platforms
Limit exposure per protocol
3. Monitor Positions
Set up alerts
Watch for unusual activity
| Be ready to withdraw
4. Use Established Protocols
Higher TVL ≠ safer
But track record matters
Avoid unaudited code
5. Understand Risks
DeFi is experimental
Losses possible
Never invest more than you can lose
After an Exploit
For Protocols
Immediate Actions :
Pause protocol (if possible)
Assess damage
Identify vulnerability
Communicate with community
Contact law enforcement (optional)
Recovery Options :
Negotiate with attacker (white-hat)
Offer bug bounty
DAO vote on reimbursement
Insurance claims
Legal action
Post-Incident :
Post-mortem analysis
Fix vulnerability
Re-audit
Implement safeguards
Rebuild trust
For Users
If You're Affected :
Check official channels
Don't interact with suspicious contracts
Document everything
Join community discussions
Wait for protocol response
Avoiding Scams :
Fake "recovery" services
Phishing "compensation" sites
Social media impersonators
Never share private keys
Exploit Statistics
By Year
2020 : $120M+ lost
2021 : $1.3B+ lost
2022 : $3.8B+ lost
2023 : $1.7B+ lost
By Type
Bridge exploits: 35% of losses
Flash loans: 20%
Access control: 15%
| Reentrancy: 10%
Other: 20%
Resources
Rekt News - Exploit database
DeFiHackLabs
Immunefi - Bug bounties
Chainalysis - Blockchain forensics
See Also