The DeFi expert reveals how the KyberSwap attacker exploited an ‘infinite money glitch’ to deplete funds

The DeFi expert reveals how the KyberSwap attacker exploited an 'infinite money glitch' to deplete funds


The “Infinite Money Glitch” Exploit: How the KyberSwap Attack Happened

An attacker successfully drained $46 million from KyberSwap using a sophisticated smart contract exploit, according to Ambient exchange founder Doug Colkitt. The exploit, which Colkitt called an “infinite money glitch,” took advantage of KyberSwap’s concentrated liquidity feature. By tricking the contract into believing it had more liquidity than it actually did, the attacker was able to drain funds.

Understanding the Exploit

Most decentralized exchanges offer a concentrated liquidity feature that allows liquidity providers to set buy and sell prices for crypto. However, this specific exploit is unique to KyberSwap and may not work on other DEXs. The attack targeted individual pools within KyberSwap and followed a similar pattern for each attack.

The Attack Process

In one example, the attacker borrowed 10,000 wstETH (worth $23 million) from Aave and dumped $6.7 million worth of tokens into the ETH/wstETH pool. This caused the price to collapse, resulting in zero liquidity. The attacker then deposited 3.4 wstETH and offered to buy or sell within a specific price range. They withdrew 0.56 wstETH immediately after the deposit, potentially to manipulate calculations.

The attacker performed two additional swaps, pushing the price up and then back down. In theory, these swaps should have had no effect since they were trading with their own liquidity. However, due to an arithmetic peculiarity, the protocol failed to remove liquidity in one swap and added it back in the final swap. This allowed the attacker to profit by receiving 3,911 wstETH for a minimal amount of ETH.

The Result

The attacker repeated this exploit on other KyberSwap pools across multiple networks, ultimately stealing $46 million in crypto. Despite KyberSwap’s failsafe mechanisms, the attacker carefully engineered the exploit to stay just outside the range that would trigger the failsafe.

Hot Take: A Complex and Carefully Engineered Attack

Read Disclaimer
This page is simply meant to provide information. It does not constitute a direct offer to purchase or sell, a solicitation of an offer to buy or sell, or a suggestion or endorsement of any goods, services, or businesses. Lolacoin.org does not offer accounting, tax, or legal advice. When using or relying on any of the products, services, or content described in this article, neither the firm nor the author is liable, directly or indirectly, for any harm or loss that may result. Read more at Important Disclaimers and at Risk Disclaimers.

The KyberSwap attack stands out as one of the most complex and carefully engineered smart contract exploits ever seen. The attacker leveraged a unique implementation of concentrated liquidity and meticulously manipulated numerical values to drain funds from multiple pools. This incident highlights the importance of robust security measures and constant vigilance within the decentralized exchange ecosystem. Crypto users must remain cautious and informed to protect their assets from sophisticated attacks like this one.

Author – Contributor at | Website

Coinan Porter stands as a notable crypto analyst, accomplished researcher, and adept editor, carving a significant niche in the realm of cryptocurrency. As a skilled crypto analyst and researcher, Coinan’s insights delve deep into the intricacies of digital assets, resonating with a wide audience. His analytical prowess is complemented by his editorial finesse, allowing him to transform complex crypto information into digestible formats.