Back to Blog

LI.FI攻撃:クロスチェーンブリッジの脆弱性?いいえ、未チェックな外部呼び出しが原因です!

Code Auditing
March 21, 2022
3 min read

LI.FIプロジェクトのレポートとDaniel Von Fange氏のTwitterによると、2022年3月20日に発生したLI.FIへの攻撃を確認しました。この脆弱性に関する詳細な技術分析がないため、以下に攻撃をさらに分析します。この攻撃の根本原因はチェックされていない外部呼び出しであると判明しました。

攻撃トランザクション

攻撃プロセスを説明するために、攻撃トランザクションから始めます。以下のスクリーンショットは、トランザクション可視化システムの結果を示しています。

上記の画像に示すように、攻撃プロセス全体は非常にシンプルで、**悪意のあるスマートコントラクトはデプロイされておらず、フラッシュローンも関与していません。**攻撃者が実行した唯一のステップは、CBridgeFacetコントラクトswapAndStartBridgeTokensViaCBridge(0x01c0a31a)関数を呼び出したことです。これにより、USDC、MATIC、RPL、GNO、USDT、MVI、AUDIO、AAVE、JRT、DAIなどのさまざまなトークンが、攻撃者が制御するEOAコントローラーから転送されました。

コード分析

次に、被害者であるロジックコントラクトのコードを調べます。

のコード
のコード
のコード
のコード

上記のコードによると、swapAndStartBridgeTokensViaCBridgeは、ソースチェーンでのクロスチェーントランザクションのエントランスです。

LIFIプロジェクトは、オフチェーンで発生するSmart Routingと呼ばれる、ユーザーに最適なルートを見つけることができると主張しています。具体的には、フロントエンドウェブサイトが最適なルートを計算し、パラメータ(スワップコントラクトとルーティングパスを含む)をswapAndStartBridgeTokensViaCBridge関数のパラメータにエンコードします。

明らかに、LIFIプロジェクトは、ホワイトリストやスワップスリッページなどのパラメータに対するチェックが行われないため、この関数が任意のアカウントによってブロックチェーン上で呼び出される可能性があることを考慮していません。最も深刻な点は、CBridgeFacetコントラクトがユーザーにトークンの承認を要求しており、これがユーザーのお金を危険にさらすことです。

利益

結果として、攻撃者はswapAnStartBridgeTokensViaCBridge関数を呼び出すことによって、CBridgeFacetコントラクトにトークンの承認を与えていたLIFIユーザーのお金を盗みました。この関数は、さまざまなトークンのtransferFrom関数を呼び出します。損失統計は以下の表に示されています。総損失は約596Kドルで、これはLIFIプロジェクトの統計とほぼ同じです。

トークン 金額 価格
GNO 0.94 310.22
USDC 202,012.28 0.999655
MATIC 3,144.89 1.46
AUDIO 1,202.37 1.10
AAVE 8.99 149.99
RPL 44.86 31.2
MVI 22.95 131.82
USDT 368,745.29 1
DAI 8,421.49 0.999847
JRT 136,805.06 0.03789613

教訓

このLIFIはクロスチェーンブリッジアグリゲーターであり、被害者コントラクトはクロスチェーン転送のエントランスです。脆弱性は、前回のクロスチェーンブリッジのセキュリティインシデントでも示されたように、複雑なクロスチェーンロジックによるものではありません。むしろ、この攻撃の根本原因は、solidityのトップ10の一般的な問題の1つであるチェックされていない外部呼び出しです。

DeFiプロジェクトがより複雑になるにつれて、プロジェクト開発者は、正しいビジネスコードを書くだけでなく、安全なコードを書くことにもっと注意を払う必要があります。監査されていないコントラクトをブロックチェーンにデプロイしないことを強く推奨します。

BlockSecについて

BlockSecは、世界的に著名なセキュリティ専門家グループによって2021年に設立された、先駆的なブロックチェーンセキュリティ企業です。同社は、Web3の世界のセキュリティとユーザビリティを向上させ、その大量採用を促進することに専念しています。この目的のために、BlockSecは、スマートコントラクトおよびEVMチェーンのセキュリティ監査サービス、セキュリティ開発と脅威のプロアクティブなブロックのためのPhalconプラットフォーム、資金追跡および調査のためのMetaSleuthプラットフォーム、そして暗号世界で効率的にサーフィンするためのWeb3ビルダーのためのMetaDock拡張機能を提供しています。

現在までに、同社はMetaMask、Uniswap Foundation、Compound、Forta、PancakeSwapなど300以上の著名なクライアントにサービスを提供し、Matrix Partners、Vitalbridge Capital、Fenbushi Capitalなどの著名な投資家から2回の資金調達で数千万米ドルを獲得しています。

公式ウェブサイト:https://blocksec.com/

公式Twitterアカウント:https://twitter.com/BlockSecTeam

Sign up for the latest updates
~$4.72M Lost: TAC, Transit Finance & More | BlockSec Weekly
Security Insights

~$4.72M Lost: TAC, Transit Finance & More | BlockSec Weekly

This BlockSec weekly security report covers 3 notable attack incidents identified between May 11 and May 17, 2026, across TRON, TON, and Ethereum, with total estimated losses of approximately $4.72M. Three incidents are analyzed in detail: the highlighted $1.88M Transit Finance exploit on TRON, where a deprecated swap bridge contract with lingering token approvals was exploited through arbitrary calldata forwarding; the $2.8M TAC TON-to-EVM bridge exploit caused by missing canonical wallet verification in the jetton deposit flow; and the $46.75K Boost Hook exploit on Ethereum, where spot price manipulation on a Uniswap V4 hook-based perpetual protocol forced the protocol to buy tokens at inflated prices using its own reserves.

~$15.9M Lost: Trusted Volumes, Wasabi & More | BlockSec Weekly
Security Insights

~$15.9M Lost: Trusted Volumes, Wasabi & More | BlockSec Weekly

This BlockSec bi-weekly security report covers 11 notable attack incidents identified between April 27 and May 10, 2026, across Sui, Ethereum, BNB Chain, Base, Blast, and Berachain, with total estimated losses of approximately $15.9M. Three incidents are analyzed in detail: the highlighted $1.14M Aftermath Finance exploit on Sui, where a signed/unsigned semantic mismatch in the builder-fee validation allowed an attacker to inject a negative fee that was converted into positive collateral during settlement; the $5.87M Trusted Volumes RFQ authorization mismatch on Ethereum; and the $5.7M Wasabi Protocol infrastructure-to-contract-control compromise across multiple EVM chains.

Newsletter - April 2026
Security Insights

Newsletter - April 2026

In April 2026, the DeFi ecosystem experienced three major security incidents. KelpDAO lost ~$290M due to an insecure 1-of-1 DVN bridge configuration exploited via RPC infrastructure compromise, Drift Protocol suffered ~$285M from a multisig governance takeover leveraging Solana's durable nonce mechanism, and Rhea Finance incurred ~$18.4M following a business logic flaw in its margin-trading module that allowed circular swap path manipulatio

Best Security Auditor for Web3

Validate design, code, and business logic before launch. Aligned with the highest industry security standards.

BlockSec Audit