Back to Blog

実録:価格操作攻撃(再び)— Rari Capital事件

Code Auditing
May 9, 2021

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トークンの価格は、攻撃者がwork関数を呼び出すことによって操作される可能性があります。

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

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

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

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

攻撃プロセス

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

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

まとめ

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

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
Drift Protocol Incident: Multisig Governance Compromise via Durable Nonce Exploitation
Security Insights

Drift Protocol Incident: Multisig Governance Compromise via Durable Nonce Exploitation

On April 1, 2026 (UTC), Drift Protocol on Solana suffered a $285.3M loss after an attacker exploited Solana's durable nonce mechanism to delay the execution of phished multisig approvals, ultimately transferring administrative control of the protocol's 2-of-5 Squads governance with zero timelock. With full admin privileges, the attacker created a malicious collateral market (CVT), inflated its oracle price, relaxed withdrawal protections, and drained USDC, JLP, SOL, cbBTC, and other assets through 31 rapid withdrawals in approximately 12 minutes. This incident highlights how durable nonce-based delayed execution can decouple signer intent from on-chain execution, bypassing the temporal assumptions that multisig security implicitly relies on.

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

Weekly Web3 Security Incident Roundup | Mar 23 – Mar 29, 2026

This BlockSec weekly security report covers eight DeFi attack incidents detected between March 23 and March 29, 2026, across Ethereum and BNB Chain, with total estimated losses of approximately $1.53M. Incidents include a $679K flawed burn mechanism exploit on the BCE token, a $512K spot-price manipulation attack on Cyrus Finance's PancakeSwap V3 liquidity withdrawal, a $133.5K flash-loan-driven referral reward manipulation on a TUR staking contract, and multiple integer overflow, reentrancy, and accounting error vulnerabilities in DeFi protocols. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Newsletter -  March 2026
Security Insights

Newsletter - March 2026

In March 2026, the DeFi ecosystem experienced three major security incidents. Resolv Protocol lost ~$80M due to compromised privileged infrastructure keys, BitcoinReserveOffering suffered ~$2.7M from a double-minting logic flaw, and Venus Protocol incurred ~$2.15M following a donation attack combined with market manipulation.

Best Security Auditor for Web3

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

BlockSec Audit