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
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

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly
Security Insights

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly

This BlockSec weekly security report covers eight attack incidents detected between April 20 and April 26, 2026, across Ethereum, Avalanche, Sui, Base, HyperLiquid, and MegaETH, with total estimated losses of approximately $7.04M. The highlighted incident is the $1.3M GiddyDefi exploit, where the attacker did not break any cryptography or use a flash loan but simply replayed an existing on-chain EIP-712 signature with the unsigned `aggregator` and `fromToken` fields swapped out for a malicious contract, demonstrating how partial signature coverage turns any historical signature into a generic permit. Other incidents include a $3.5M Volo Vault operator key compromise on Sui, a $1.5M Purrlend privileged-role takeover, a $413K SingularityFinance oracle misconfiguration, a $142.7K Scallop cross-pool index injection, a $72.35K Kipseli Router decimal mismatch, a $50.7K REVLoans (Juicebox) accounting pollution, and a $64K Custom Rebalancer arbitrary-call exploit.

Weekly Web3 Security Incident Roundup | Apr 13 – Apr 19, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Apr 13 – Apr 19, 2026

This BlockSec weekly security report covers four attack incidents detected between April 13 and April 19, 2026, across multiple chains such as Ethereum, Unichain, Arbitrum, and NEAR, with total estimated losses of approximately $310M. The highlighted incident is the $290M KelpDAO rsETH bridge exploit, where an attacker poisoned the RPC infrastructure of the sole LayerZero DVN to fabricate a cross-chain message, triggering a cascading WETH freeze across five chains and an Arbitrum Security Council forced state transition that raises questions about the actual trust boundaries of decentralized systems. Other incidents include a $242K MMR proof forgery on Hyperbridge, a $1.5M signed integer abuse on Dango, and an $18.4M circular swap path exploit on Rhea Finance's Burrowland protocol.

Best Security Auditor for Web3

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

BlockSec Audit