Here are three specific, high-impact DeFi smart contract vulnerabilities commonly identified in professional audits, complete with technical details, root causes, and mitigation strategies.
1. Reentrancy in State-Dependent Functions
Vulnerability Class: Reentrancy (CWE-693)
Severity: High/Critical
Affected Component: Token or Vault Contracts with External Calls
Technical Description
Reentrancy occurs when a contract calls an external contract that allows the attacker to call back into the original contract before the first execution finishes. In DeFi, this is especially dangerous in functions that modify state after making an external call (e.g., token transfers, AMR swaps, or oracle updates).
Example Scenario:
A liquidity vault allows users to withdraw their share. The withdraw() function:
- Calculates the user’s share.
- Sends ETH/tokens to the user via `msg.sender.transfer(amount)
Top comments (0)