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

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.