On July 30, 2023, JPEG’d experienced a significant security breach due to a reentrancy vulnerability resulting in a loss of ~11.4M USD.
Vyper versions 0.2.15, 0.2.16 and 0.3.0 are vulnerable to malfunctioning reentrancy locks. AlchemixFi, MetronomeDAO, DebridgeFinance and Ellipsisfi are some more projects that faced a similar issue.
Fig: Attack Transaction
add_liquidity
function without waiting for it to complete its execution. Specifically, the attacker reentered the add_liquidity
function even before it had finished processing the previous call.remove_liquidity
function, which is responsible for removing liquidity from the pool. This action led to a decrease in the available balance in the pool.add_liquidity
function.Fig: The root cause of the vulnerability
Fig: Attack Flow
Caligo — Smart Contract Vulnerability Scanner
Caligo is an advanced smart-contract scanning tool that discovers vulnerabilities and reduces risks in code. Request a security audit with us, and we will help you secure your smart contracts.
Follow us on our Social Media for Web3 security-related updates.
Caligo Security — LinkedIn | Twitter | Telegram