Cointime

Download App
iOS & Android

Radiant Protocol on Arbitrum Suffers Flashloan Attack, Resulting in $4.5M Loss: In-Depth Analysis Reveals Exploit Details

From MetaTrust Labs by Daniel Tan

TL;DR

On Jan-03–2024 UTC+8:00, the Radiant protocol on Arbitrum was under the flashloan attack. The hacker attacked the #Radiant protocol 3 times, resulting in a total loss of 1.9K $ETH(worth $4.5m). The root cause is the mathematical rounding issue in the `burn` function that is amplified and used, on a new $USDC market, which makes the hacker withdraw an extra $USDC.

MetaTrust Labs conducted in-depth research and analysis on the exploit, revealing how the hacker exploits vulnerability.

On Jan-03–2024 UTC+8:00, the Radiant protocol on Arbitrum was under the flashloan attack. The hacker attacked the #Radiant protocol 3 times, resulting in a total loss of 1.9K $ETH(worth $4.5m). The root cause is the mathematical rounding issue in the `burn` function that is amplified and used, on a new $USDC market, which makes the hacker withdraw an extra $USDC.

MetaTrust Labs conducted in-depth research and analysis on the exploit, revealing how the hacker exploits vulnerability.

Radiant Protocol

Radiant is a decentralized, non-custodial lending protocol, on multiple chains, including Arbitrum, BNBChain, and Ethereum.

Radiant protocol’s total value locked still has $313M after the attack, due to their rapid pause of protocol after the attack, stopped the further loss.

Timeline

Transactions

0xc5c4bbddec70edb58efba60c1f27bce6515a45ffcab4236026a5eeb3e877fc6d

0x2af556386c023f7ebe7c662fd5d1c6cc5ed7fba4723cbd75e00faaa98cd14243

0x1ce7e9a9e3b6dd3293c9067221ac3260858ce119ecb7ca860eac28b2474c7c9b

Asset Loss

3 attacking transactions resulted in a total loss of 1.9K $ETH, worth $4.5M. At the time of writing, the 1.9K $ETH is still held in the hacker’s wallet(0x826d5f4d8084980366f975e10db6c4cf1f9dde6d).

Attacker

0x826d5f4d8084980366f975e10db6c4cf1f9dde6d

Attacking Contract

0x39519c027b503f40867548fb0c890b11728faa8f

Victim Contract

Radiant: Lending Pool(0xf4b1486dd74d07706052a33d31d7c0aafd0659e1)

rUSDCn(0x3a2d44e354f2d88ef6da7a5a4646fd70182a7f55).

What Happened Before the Attack

15 seconds before the attack, a new native USDC market on Arbitrum was created by the client.

The hacker is the first one who interacts with the new USDC market.

Attacking Steps

Take the first attacking transaction, 0x1ce7e9a9e3b6dd3293c9067221ac3260858ce119ecb7ca860eac28b2474c7c9b, as an example.

  1. Borrow 3M $USDC from AAVE with the flashloan function;
  2. Deposit 2M $USDC into Radiant Pool, with liquidityIndex as 1e27

3. Do a $2M flashloan on Radiant Lending Pool, to inflate the liquidityIndex to 1.8e36.

4. Repeatedly execute step 3, 151 times, to inflate the liauidityIndex to 2.7e38, which is 270000000000 times of its initial value.

5. Borrow 90.6 $ETH, worth $215K, from Radiant Pool, which is the profit of this attack;

6. Create a new contract (0xd8b591);

7. Approve an unlimited allowance of USDC to the new contract, transfer 543K $USDC to the new contract, and execute the below steps with the new contract;

8. Deposit 543K $USDC to the Radiant pool, to mint 2 wei tokens because amountScaled is 2, 543600000002*1e27/271800000000999999999999998631966035920=2;

9. Withdraw 407K $USDC from the Radiant pool, only burn 1 wei token because amountScaled is 1, 407700000000*1e27/271800000000999999999999998631966035920=1.5 and the mathematical rounding issue. Note that amountScaled is a uint256 type variable that will turn 1.5 into 1.

10. Deposit 271K $USDC to the Radiant pool, mint 1 wei token because the amountScaled as 1, 271800000001*1e27/271800000000999999999999998631966035920=1 ;

11. Withdraw 407K $USDC from the Radiant pool, only burn 1 wei token because amountScaled is 1.

12. Repeat steps 10 and 11 as many as 18 times, and drain all the $USDC, which was deposited by the hacker before, from the new market.

13. Swap 2 $WETH for 4.73K $USDC, swap 3.23K $USDC for 1.36 $WETH.

14. Repay flashloan from AAVE with 3.5m $USDC as principal and 1.5K $USDC as a fee.

15. Get a profit of 90 $ETH.

Root Cause

The root causes are that the hacker is the first one who interacts with the newly created native USDC market, inflates liquidityIndex with the floanloan feature of Radiant protocol, and uses the mathematical rounding issue to steal collateral from the lending pool.

Key Code

About MetaTrust Labs

MetaTrust Labs is a leading provider of Web3 AI security tools and code auditing services incubated at Nanyang Technological University, Singapore. We provide advanced AI solutions that empower developers and project stakeholders to protect Web3 applications and smart contracts. At MetaTrust Labs, we are committed to protecting the Web3 space so that builders can innovate with confidence and reliability.

Comments

All Comments

Recommended for you

  • Telegram Renames Gram Wallet to Money and Launches for All Users

    On October 9, Telegram officially renamed its previously limited-access wallet service 'Gram wallet' to 'Money' and launched it to over one billion users across the platform. 'Money' is an integrated wallet for the Gram token, supporting storage, transfers, and purchases of platform gifts and collectible usernames. Additionally, the accompanying trading platform 'Walt' offers services for over 300 assets, including tokenized stocks, precious metals, perpetual contracts, and wealth management projects. Users can make instant transfers from 'Walt' to the 'Money' wallet without incurring network fees. The official statement also cautions that investing in crypto assets carries associated risks.

  • Blockchain.com Seeks Approval for Prediction Markets and Cryptocurrency Derivatives Trading

    On October 9, the crypto asset platform Blockchain.com submitted an application to the U.S. Commodity Futures Trading Commission (CFTC) seeking to obtain licenses for a designated contract market (DCM) and a futures commission merchant (FCM) to offer event contracts (prediction markets) and cryptocurrency derivatives trading services to U.S. users.

  • US May Seize Approximately $1 Billion in Cryptocurrency Related to Iran This Week

    U.S. Treasury Secretary Bencet stated at the NPolicy Summit held by Newsmax in Washington on Thursday that we may seize $1 billion in cryptocurrency this week, adding, "We know where it is, and we are isolating them." Bencet noted that the Trump administration's approach to Iran has shifted from 'maximum pressure' to 'absolute isolation,' with measures including maritime blockades, restrictions on air travel, and the cutting off of land routes. The UAE and Oman are cooperating with the U.S., which is also working with Pakistan and Turkey to cut off all land routes in and out of Iran.

  • Zcash Development Team Plans to Introduce Quantum-Resistant Signatures in January

    The development team of the privacy cryptocurrency Zcash (ZEC) plans to introduce post-quantum signature opcodes to the network in January next year, supporting hash-based signature technology to defend against potential quantum computing attacks. This solution primarily targets the transparent (public) payment pool, where approximately 70% of ZEC is currently stored. Although the developers have set January as the target deadline, the specific network activation time has not yet been finalized. This upgrade aims to prevent attackers from using existing public keys to reverse-engineer private keys and forge payment authorizations. Additionally, the Zcash node validator Zakura has launched a wallet tool based on Private Information Retrieval (PIR), allowing users to query balances across multiple addresses without revealing the correlation between those addresses to the server. Previously, Ethereum researcher Justin Drake warned that artificial intelligence could accelerate the cracking of traditional encryption algorithms and urged cryptocurrency holders to prepare for potential security threats.

  • BTC Surpasses $83,000

    Market data shows that BTC has surpassed $83,000, currently priced at $83,017.3, with a 24-hour increase of 0.66%. The market is highly volatile, so please ensure proper risk management.

  • Central Committee and State Council: Comprehensive Implementation of 'AI+' Initiative

    On October 9, the Central Committee of the Communist Party of China and the State Council issued the 'Opinions on Developing New Quality Productive Forces.' The opinions mention the comprehensive implementation of the 'AI+' initiative. This includes promoting the transformation of traditional industries through artificial intelligence, accelerating the development of new-generation intelligent terminal applications such as smart connected new energy vehicles, AI smartphones and computers, and humanoid robots. It aims to speed up innovation in digital intelligence technologies like artificial intelligence, break through foundational theories and core technologies, and strengthen the efficient supply of computing power, algorithms, and data. The strategy involves tailored approaches based on local conditions and industry-specific policies to layout national pilot bases for AI industry applications and high-value application scenarios, vigorously promoting the application of AI across various sectors. Additionally, it emphasizes the establishment of a technology monitoring, risk warning, and emergency response system to ensure that artificial intelligence is safe, reliable, and controllable.

  • U.S. Government-Related Wallet Deposits 17,733 BTC and 750 WBTC to Coinbase Prime

    On October 9, according to monitoring by Lookonchain, wallets associated with the U.S. government have deposited 17,733 BTC (worth $1.48 billion) and 750 WBTC (worth $62 million) into Coinbase Prime over the past three days. According to tagging data from Arkham, these wallets currently hold cryptocurrency assets valued at $25.4 billion, with Bitcoin alone valued at $25.3 billion.

  • ETH Falls Below $2500

    Market data shows that ETH has fallen below $2500, currently priced at $2499.87, with a 24-hour decline of 2.55%. The market is experiencing significant volatility, so please ensure proper risk management.

  • ETH Surpasses $2500

    Market data shows that ETH has surpassed $2500, currently priced at $2500.13, with a 24-hour decline of 2.21%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Surpasses $82,000

    Market data shows that BTC has surpassed $82,000, currently priced at $82,002.01, with a 24-hour decline of 1.47%. The market is highly volatile, so please ensure proper risk management.