Back to Blog

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

Code Auditing
March 21, 2022

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のコード
swapAndStartBridgeTokensViaCBridgeのコード
LibSwap.swapのコード
LibSwap.swapのコード

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

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

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

利益

結果として、攻撃者はswapAnStartBridgeTokensViaCBridge関数を呼び出すことによって、CBridgeFacetコントラクトにトークンの承認を与えていたLIFIユーザーのお金を盗み、その後、さまざまなトークンのtransferFrom関数を呼び出しました。損失の統計は下の表に示されています。総損失は約596,000ドルで、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
Tether Freezes $6.76M USDT Linked to Iran's IRGC & Houthi Forces: Why On-Chain Compliance is Now a Geopolitical Battlefield
Security Insights

Tether Freezes $6.76M USDT Linked to Iran's IRGC & Houthi Forces: Why On-Chain Compliance is Now a Geopolitical Battlefield

Looking ahead, targeted freezing events like this $6.76M USDT action will only become more common. On-chain data analysis is improving. Stablecoin issuers are also working closely with regulators. As a result, hidden illicit financial networks will be exposed.

Weekly Web3 Security Incident Roundup | Mar 2 – Mar 8, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Mar 2 – Mar 8, 2026

During the week of March 2 to March 8, 2026, seven blockchain security incidents were reported with total losses of ~$3.25M. The incidents occurred across Base, BNB Chain, and Ethereum, exposing critical vulnerabilities in smart contract business logic, token deflationary mechanics, and asset price manipulation. The primary causes included a double-minting logic flaw during full token deposits that allowed an attacker to exponentially inflate their balances through repeated burn-and-mint cycles, a price manipulation vulnerability in an AMM-based lending market where artificially inflated vault shares created divergent price anchors to incorrectly force healthy positions into liquidation, and a flawed access control implementation relying on trivially spoofed contract interfaces that enabled attackers to bypass authorization to batch-mint and dump arbitrary tokens.

Weekly Web3 Security Incident Roundup | Feb 23 – Mar 1, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Feb 23 – Mar 1, 2026

During the week of February 23 to March 1, 2026, seven blockchain security incidents were reported with total losses of ~$13M. The incidents affected multiple protocols, exposing critical weaknesses in oracle design/configuration, cryptographic verification, and core business logic. The primary drivers included oracle manipulation/misconfiguration that led to the largest loss at YieldBloxDAO (~$10M), a crypto-proof verification flaw that enabled the FOOMCASH (~$2.26M) exploit, and additional token design and logic errors impacting Ploutos, LAXO, STO, HedgePay, and an unknown contract, underscoring the need for rigorous audits and continuous monitoring across all protocol layers.