Here are three specific DeFi smart contract vulnerabilities commonly identified in audit reports, described with technical precision suitable for a professional security assessment.
1. Reentrancy Attack (CEI Violation)
Description:
This vulnerability occurs when a smart contract calls an external contract (e.g., a DEX or another protocol) before updating its own internal state (e.g., user balances). If the external contract is malicious or compromised, it can re-enter the vulnerable function before the state update completes, allowing an attacker to repeatedly invoke the function and drain funds.
Specific Technical Scenario:
- A lending protocol’s
withdraw(uint256 amount)function sends ETH to the user viacall{value: amount}(user)before updatingbalances[user] -= amount. - If the
useraddress is an attacker-controlled contract, itsreceive()orfallback()function can recursively callwithdraw()again. - Since `balances
Top comments (0)