Back to Blog

Vee Financeセキュリティインシデントの真の原因

Code Auditing
September 22, 2021

VEE Financeは、最近のセキュリティインシデントに関するレポートを公開しました。レポートでは、主な原因として「Vee Financeオラクルマシンの価格操作とオラクルマシン価格の取得が小数点で処理されなかったため、スワップ前の期待されるスリッページチェックが機能しなかった」と述べています。

「事故の主な原因は、レバレッジ取引の注文作成プロセスにおいて、オラクルが価格フィードのソースとしてPangolinプールの価格のみを使用し、プールの価格が3%以上変動したことです。オラクルは価格を更新し、攻撃者はPangolinプールの価格を操作しました。Vee Financeオラクルマシンの価格操作とオラクルマシン価格の取得が小数点で処理されなかったため、スワップ前の期待されるスリッページチェックが機能しませんでした。」 — VEE Financeが公開したレポートより抜粋。

しかし、我々の慎重な調査の結果、これはそうではない可能性があることがわかりました。本当の理由は、攻撃者が偽のctokenBを作成し、コントラクトに渡したことです。ctokenBは攻撃者が制御できるため、トークン価格の計算に使用される基盤トークンを任意に返すことができます。これが攻撃の真の根本原因です。

全体プロセス

createOrderERC20ToERC20という外部関数があり、ユーザーは誰でも、コントラクトに担保を預けることで取得したctokenを使用してトークンスワップを作成するために呼び出すことができます。ctokenには、実際のトークンを表す基盤トークンがあります。

通常のケースでは、レバレッジを使用してトークンペアを取引するためにcreateOrderERC20ToERC20を呼び出す際、dappは取引で損失が発生しないことを保証する必要があります(そうでなければ、dappは損失を被ります)。これはgetAmountOutMin関数を呼び出すことで強制されます。

例えば、dappに0.95 ETHを預け入れ、0.5 ETHの価値を持つctoken(過剰担保)を取得したとします。その後、3倍のレバレッジを使用して、ユーザーに代わってdappに1.5 ETHを別のトークン(例えばtokenX)と取引するように依頼できます。この場合、損失を防ぐために、dappは取引されたtokenXの価値が0.95 * 1.5 ETHを下回らないことを保証する必要があります(そうでなければ、dappは損失を被るリスクがあります)。dappは外部価格オラクルを利用してETHとtokenXの価値を計算します。

しかし、createOrderERC20ToERC20関数は、渡されたctokenBを検証しません。したがって、攻撃者は自身のコントラクトをctokenBとして実装し、createOrderERC20ToERC20関数に渡すことができました。その結果、この偽のctokenBは、createOrderERC20ToERC20getAmountOutMinで呼び出されたときに基盤トークンとしてLINK(0x5947bb275c521040051d82396192181b413227a3)を返しますが、IPriceOracle(oracle).getUnderlyingPrice(createParams.ctokenB)で呼び出されたときには基盤トークンとしてBTCを返します。これにより、isRightPriceチェックを回避できます。なぜなら、価格計算に使用されるトークンは(LINKではなく)BTCだからです。これは、priceBの戻り値、0x15e1549d1216fe9fc032e7c00000443783124870000000000000000000000)で確認できます。これはBTCの価格です。

結論

要約すると、攻撃者はctokenBのチェック漏れを悪用しました。ctokenBは信頼できるものではないため、ctokenBが返す基盤トークンも信頼できません。しかし、この攻撃で価格オラクルは侵害されていません。

まとめ

DeFiプロジェクトを安全にすることは容易ではありません。コード監査に加えて、コミュニティはプロジェクトのステータスを積極的に監視し、攻撃が発生する前にブロックするべきだと考えています。

BlockSecについて

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

現在までに、同社は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
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.

The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis
Security Insights

The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis

This BlockSec deep-dive analyzes the KelpDAO $290M rsETH cross-chain bridge exploit (April 18, 2026), attributed to the Lazarus Group, tracing a causal chain across three layers: how a single-point DVN dependency enabled the attack, how DeFi composability cascaded the damage through Aave V3 lending markets to freeze WETH liquidity exceeding $6.7B across Ethereum, Arbitrum, Base, Mantle, and Linea, and how the crisis forced decentralized governance to exercise centralized emergency powers. The article examines three parameters that shaped the cascade's severity (LTV, pool depth, and cross-chain deployment count) and provides an exclusive technical breakdown of Arbitrum Security Council's forced state transition, an atomic contract upgrade that moved 30,766 ETH without the holder's signature.

Weekly Web3 Security Incident Roundup | Apr 6 – Apr 12, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Apr 6 – Apr 12, 2026

This BlockSec weekly security report covers four DeFi attack incidents detected between April 6 and April 12, 2026, across Linea, BNB Chain, Arbitrum, Optimism, Avalanche, and Base, with total estimated losses of approximately $928.6K. Notable incidents include a $517K approval-related exploit where a user mistakenly approved a permissionless SquidMulticall contract enabling arbitrary external calls, a $193K business logic flaw in the HB token's reward-settlement logic that allowed direct AMM reserve manipulation, a $165.6K exploit in Denaria's perpetual DEX caused by a rounding asymmetry compounded with an unsafe cast, and a $53K access control issue in XBITVault caused by an initialization-dependent check that failed open. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Best Security Auditor for Web3

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

BlockSec Audit