Back to Blog

現実における価格操作攻撃(再び):RariCapital事件

Code Auditing
May 9, 2021
5 min read

5月8日、PeckshieldはRariCapitalに関するセキュリティインシデントを報告しました。慎重な調査の結果、これは我々の論文で説明されている価格操作攻撃(間接的なもの)の一種であることが判明しました:DeFiRanger: Detecting Price Manipulation Attacks on DeFi Applications。この論文では、直接的および間接的な価格操作攻撃を含む、DeFiアプリケーションに対する2種類の新しい攻撃の検出に焦点を当てています。前者とは、攻撃者が脆弱なDeFiアプリを攻撃することで、同じDEXで望ましくない取引を実行することにより、DEX内のトークン価格を直接操作することを意味します。後者とは、攻撃者が脆弱なDeFiアプリのトークン価格を間接的に操作することを意味します。このセキュリティインシデントは、間接的な価格操作攻撃の一例です。

原因

攻撃の根本原因を分析した結果、不確実な価格依存性が原因であることが判明しました。具体的には、RariのLPトークンの価格は、Rariが保有するLPトークン(ibEth)の価値(Ether建て)に依存しています。残念ながら、ibEth LPトークンの価格は、攻撃者がibEthのwork関数を呼び出すことによって操作される可能性があります。

Rariが保有するRariトークン価値 = Rari内のETH準備金 * Rariトークン数/Rariトークン総供給量

Rariが保有するibEthトークン価値 = ibEth内のETH準備金 * ibEthトークン数/ibEthトークン総供給量

Rari内のETH準備金は、ibEthが保有するibEthトークン価値に影響を受けます。これは、攻撃者がibEth内のETH準備金を増やすこと(work関数を呼び出すこと)によって操作されます。

我々のシステムDefiRangerを使用すると、図に示されているDeFiのセマンティクスを容易に復元できます。流動性マイニング(LPトークンを取得するためにEtherを預ける)と流動性キャンセル(Etherを取得するためにLPトークンを引き出す)におけるLPトークンの数は、同じEther量(緑色の背景)に対して異なります(赤い円で囲まれています)。

攻撃プロセス

攻撃プロセスを以下のステップで示します。

1)攻撃者はibEthのwork関数を呼び出します。 2)この関数はSushiswapGoblin.work関数を呼び出し、さらに攻撃者が制御するコントラクト(0x2f755e8980f0c2e81681d82cccd1a4bd5b4d5d46)を呼び出します。

3)コントラクトはまず、Rariに58903.4755276693 Ether(フラッシュローンから借り入れたもの)を預け入れ、RariのLPトークン(146281892117489076580650)を取得します。 4)攻撃者は3818.9022134987213 EtherをibEthに転送します。これは、ibEth LPトークンの価格を上昇させる(その総供給量には影響を与えずに)重要なステップであり、これによりRariのLPトークンの価格もさらに影響を受けます。これは、Rariのプール内の総Ether準備金が、保有するibEth LPトークンの価格上昇により増加するためです。なお、攻撃者は流動性を追加することによってRariまたはibEthのトークン価格を操作することはできません。なぜなら、それによってもトークンの総供給量が増加してしまうからです。 5)攻撃者はEtherを引き出します。Rariトークンの価格が高くなっているため、攻撃者は(146281892117489076580650ではなく)より少ないRari LPトークンを使用して、同じ量のEtherを取得し、フラッシュローンを返済することができます。

6)攻撃者はwork関数の終了時に返還されたEtherを取得します。

まとめ

結論として、RariCapitalが直面したセキュリティ侵害は、DeFiアプリケーションに潜む洗練された脅威を鮮明に思い起こさせます。巧妙な悪用戦略を通じて、攻撃者は間接的な価格操作攻撃を実行しました。このインシデントは、スマートコントラクトにおける不確実な価格依存性の使用に関連する重大な脆弱性を明らかにしました。この攻撃は、DeFiプロジェクトが、成長するDeFiエコシステムの完全性とセキュリティを脅かす直接的および間接的な操作戦術から保護するために、DeFiRangerのような堅牢な検出システムを採用する必要性を緊急に示しています。

BlockSecについて

BlockSecは、2021年に世界的に著名なセキュリティ専門家グループによって設立された、先駆的なブロックチェーンセキュリティ企業です。同社は、Web3の世界の普及を促進するために、新しい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
~$15.9M Lost: Trusted Volumes & More | BlockSec Weekly
Security Insights

~$15.9M Lost: Trusted Volumes & 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

~$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.

Best Security Auditor for Web3

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

BlockSec Audit