According to a report by Jinse Finance, and as monitored by SlowMist, on December 1, the decentralized finance protocol Yearn suffered a hacker attack resulting in a loss of approximately $9 million. The SlowMist security team analyzed the incident and confirmed the root cause as follows:
The vulnerability originated from the calcsupply function logic used to calculate supply in the Yearn yETH Weighted Stableswap Pool contract. Due to unsafe mathematical operations, the function allowed overflow and rounding errors during calculations, which caused significant deviations in the product of the new supply and virtual balance. Attackers exploited this flaw to manipulate liquidity to specific values and excessively mint liquidity pool (LP) tokens, thereby profiting illegally.
It is recommended to strengthen boundary scenario testing and adopt security-audited arithmetic mechanisms to prevent similar high-risk vulnerabilities, such as overflows, in related protocols.
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
SlowMist: The root cause of the yearn attack is that the Yearn yETH weighted stablecoin swap pool contract contains unsafe mathematical operations.
According to a report by Jinse Finance, and as monitored by SlowMist, on December 1, the decentralized finance protocol Yearn suffered a hacker attack resulting in a loss of approximately $9 million. The SlowMist security team analyzed the incident and confirmed the root cause as follows: The vulnerability originated from the calcsupply function logic used to calculate supply in the Yearn yETH Weighted Stableswap Pool contract. Due to unsafe mathematical operations, the function allowed overflow and rounding errors during calculations, which caused significant deviations in the product of the new supply and virtual balance. Attackers exploited this flaw to manipulate liquidity to specific values and excessively mint liquidity pool (LP) tokens, thereby profiting illegally. It is recommended to strengthen boundary scenario testing and adopt security-audited arithmetic mechanisms to prevent similar high-risk vulnerabilities, such as overflows, in related protocols.