Back to Blog

#7:パラスペース事件:業界史上最重要攻撃を阻止せよ、時間との戦い

February 17, 2024
5 min read

背景

2023年3月17日、NFT貸付プラットフォームであるParaspace(現Parallel Finance)は、価格オラクルの脆弱性により、重大な攻撃を受けました。Paraspaceは、ユーザーがNFTやERC-20トークンを担保として預け入れ、ERC-20トークンを借り入れることを可能にし、NFTを売却せずに収益化できるようにしています。

ツイートを読むにはこちらをクリック
ツイートを読むにはこちらをクリック

ParaSpaceの主な機能の一つはApeStakingであり、APE報酬を自動的に複利運用します。APEをステーキングしたユーザーは、APEのcToken表現であるcAPEトークンを受け取ります。これは、USDCやWETHのような資産を借り入れるための担保として使用できます。cAPEトークンを預け入れるとpcAPEシェアが付与され、その担保価値はpcAPEの数量にrebasingIndexを掛けることで計算されます。

rebasingIndexは、以下のコードスニペットに示すように、プールされたAPEの総残高と総シェアから導き出されます。

function _scaledBalanceOf(address user, uint256 rebasingIndex)
    internal
    view
    returns (uint256)
{
    return super.scaledBalanceOf(user).rayMul(rebasingIndex);
}

function lastRebasingIndex() internal view override returns (uint256) {
  return ICApe(_underlyingAsset).getPooledApeByShares(WadRayMath.RAY);
}

function getPooledApeByShares(uint256 sharesAmount)
    public
    view
    returns (uint256)
{
    uint256 totalShares = _getTotalShares();
    if (totalShares == 0) {
        return 0;
    } else {
        return
            sharesAmount.mul(_getTotalPooledApeBalance()).div(totalShares);
    }
}

function _getTotalPooledApeBalance()
    internal
    view
    override
    returns (uint256)
{
    (uint256 stakedAmount, ) = apeStaking.addressPosition(address(this));
    uint256 rewardAmount = apeStaking.pendingRewards(
        APE_COIN_POOL_ID,
        address(this),
        0
    );
    return stakedAmount + rewardAmount + bufferBalance;
}

_getTotalPooledApeBalance()関数は、ApeCoinStakingコントラクトからのステーキングされたAPEトークン、保留中の報酬、およびバッファー残高を合計します。

脆弱性分析

脆弱性は、rebasingIndexの操作にあり、これによりcAPEトークンの担保価値が人為的に膨張します。具体的には、ApeCoinStakingコントラクトのdepositApeCoin()関数は、ポジションのstakedAmountを増加させます。攻撃者は、APEトークンをcAPEポジションに預け入れることでこれを悪用し、_getTotalPooledApeBalance()、したがってrebasingIndexの出力を増加させることができます。

function depositApeCoin(uint256 _amount, address _recipient) public {
    if (_amount < MIN_DEPOSIT) revert DepositMoreThanOneAPE();
    updatePool(APECOIN_POOL_ID);

    Position storage position = addressPosition[_recipient];
    _deposit(APECOIN_POOL_ID, position, _amount);

    apeCoin.transferFrom(msg.sender, address(this), _amount);

    emit Deposit(msg.sender, _amount, _recipient);
}

function _deposit(uint256 _poolId, Position storage _position, uint256 _amount) private {
  Pool storage pool = pools[_poolId];
  _position.stakedAmount += _amount;
  pool.stakedAmount += _amount.toUint96();
  _position.rewardsDebt += (_amount * pool.accumulatedRewardsPerShare).toInt256();
}

この設計上の欠陥により、攻撃者はdepositApeCoin()をcAPEを宛先として呼び出すことで、APEトークンを預け入れることにより、担保価値を膨張させることができます。

攻撃分析

攻撃者は、5つの主要なステップでフラッシュローン攻撃を使用してこの脆弱性を悪用しました。

  1. 約47,352 wstETHのフラッシュローンを取得し、約46,018 wstETHを供給して、複数のコントラクトを介してcAPEを借入しました。
  2. 約12,880,000 cAPEトークンを担保として預け入れました。
  3. 約1,205 wstETHを約492,124 APEトークンと交換し、1,839,999 cAPEをAPEトークンに引き出しました。
  4. ApeCoinStaking.depositApeCoin()を呼び出すことにより、2,332,214 APEトークンをcAPEポジションに預け入れ、プロトコルのstakedAmountを851,662から3,183,876(373%増加)に増加させました。
  5. 膨張した担保を活用して、USDCやWETHなどの大量の資産を利益のために借入しました。

フラッシュローンによるpcAPE価格の操作は、オラクル計算におけるスポット価格の使用を悪用したものです。

Phalcon Securityを使い始める

あらゆる脅威を検出し、重要なアラートを出し、攻撃をブロックします。

今すぐ無料で試す

まとめ

ParaSpaceのインシデントは、DeFiプロトコルにおけるオラクル操作とフラッシュローン攻撃のリスクを浮き彫りにしました。これは、堅牢で操作に強い価格オラクルと、ローンチ前の監査を超えた継続的なセキュリティ監視の重要な必要性を強調しています。

BlockSecのPhalcon Securityシステムは、攻撃を自動的にブロックし、ユーザー資産を保護することにより、積極的な脅威検出と防止の価値を示しました。このインシデントは、DeFiプロトコルが、スマートコントラクト監査、インフラストラクチャ監査、リアルタイム監視を含む包括的なセキュリティ対策を実装するためのリマインダーとなります。

DeFiセキュリティインシデントとベストプラクティスに関する詳細については、当社のセキュリティインシデントライブラリをご覧いただくか、当社のスマートコントラクト監査およびインフラストラクチャ監査サービスをご検討ください。

MetaSleuth調査を探る

調査のためにフローをトレースし、証拠を構築する

今すぐ無料で試す

このシリーズの他の記事を読む:

Web3の最高のセキュリティ監査人

ローンチ前に設計、コード、ビジネスロジックを検証する

Sign up for the latest updates
~$4.72M Lost: TAC, Transit Finance & More | BlockSec Weekly
Security Insights

~$4.72M Lost: TAC, Transit Finance & More | BlockSec Weekly

This BlockSec weekly security report covers 3 notable attack incidents identified between May 11 and May 17, 2026, across TRON, TON, and Ethereum, with total estimated losses of approximately $4.72M. Three incidents are analyzed in detail: the highlighted $1.88M Transit Finance exploit on TRON, where a deprecated swap bridge contract with lingering token approvals was exploited through arbitrary calldata forwarding; the $2.8M TAC TON-to-EVM bridge exploit caused by missing canonical wallet verification in the jetton deposit flow; and the $46.75K Boost Hook exploit on Ethereum, where spot price manipulation on a Uniswap V4 hook-based perpetual protocol forced the protocol to buy tokens at inflated prices using its own reserves.

~$15.9M Lost: Trusted Volumes, Wasabi & More | BlockSec Weekly
Security Insights

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