Back to Blog

ポプシクル・ファイナンスのセキュリティインシデント分析

Code Auditing
August 4, 2021

2021年8月4日、Popsicle Financeは攻撃により巨額の金銭的損失(2000万ドル超)を被りました[1]。 手動分析の結果、これは「ダブルクレイム」攻撃、つまり報酬システムの抜け穴により、攻撃者が報酬を繰り返し請求できるものであることを確認しました。 以下では、攻撃プロセスと脆弱性の根本原因を説明するために、攻撃トランザクションを使用します。

背景

Popsicle Financeは、複数のチェーン(例:EthereumおよびBSC)に対応するイールド最適化プラットフォームです。

具体的には、ユーザーはまずdeposit関数を呼び出して流動性を提供し、Popsicle LPトークン(略称:PLP)を取得します。その後、Popsicle Financeはユーザーのために流動性(Uniswapなどのプラットフォームと連携)を管理して利益を上げます。 ユーザーはwithdraw関数を呼び出してPopsicle Financeから流動性を取り戻すことができます。その際、PLPトークンに基づいて金額が計算されます。 インセンティブ報酬は流動性に由来し、時間とともに蓄積されます。 ユーザーはcollectFees関数を呼び出して報酬を請求できます。これがこの攻撃の鍵となります。

脆弱性分析

collectFees関数では、token0Rewardtoken1Reward(対応するLPトークンペアの報酬)がユーザーのために計算されます。計算ロジック全体は単純です。しかし、この関数はupdateVaultというモディファイアを使用しており、これにより報酬が適切に更新されます。

要するに、updateVaultは以下のことを行います。

  1. まず、_earnFees関数を呼び出して、プールから蓄積された手数料を取得します。
  2. 次に、_tokenPerShare関数を呼び出して、token0PerShareStoredtoken1PerShareStoredを更新します。これらは、各シェアあたりのプール内のトークン0とトークン1の金額を表します。
  3. 最後に、_fee0Earned_fee1Earned関数を呼び出して、ユーザーの報酬(それぞれtoken0Rewardstoken1Rewards)を更新します。

_fee0Earned関数と_fee1Earned関数は同じロジックを共有します。つまり、以下の式を実装します(トークン0を例に取ります)。

user.token0Rewards += PLP.balanceOf(account) * (fee0PerShare - user.token0PerSharePaid) / 1e18

この計算は累積的であることに注意してください。つまり、ユーザーがPLPトークンを保有していなくても、計算された報酬はtoken0Rewardsに格納された値のままです。

したがって、以下の2つの観察結果を導き出すことができます。

  1. ユーザーの報酬はtoken0Rewardstoken1Rewardsに保存されており、これはPLPトークンとは関連付けられていません
  2. collectFees関数はtoken0Rewardstoken1Rewardsの状態のみに依存しているため、PLPトークンを保有せずに報酬を引き出すことができます

現実世界では、これはユーザーがお金を通帳に預け、銀行が預金証明書を発行するようなものです。残念ながら、この証明書は偽造防止機能がなく、ユーザーとも関連付けられていません。 この場合、複製を作成して他人に配布し、銀行から利益を得ることが可能です。

攻撃フロー

簡単に言うと、攻撃者は以下の手順で攻撃を実行しました。

  1. 3つのコントラクトを作成しました。1つは攻撃に使用され、他の2つはcollectFees関数を呼び出して報酬を取得するために使用されました。
  2. AAVEから大量の流動性を借り入れるフラッシュローンを利用しました。
  3. 攻撃を実行するためにデポジット-ウィズドロー-コレクトフィーズサイクルを起動しました(合計8サイクルあり、Popsicle Financeの複数のボルトから大量の流動性が引き出されました)。
  4. フラッシュローンをAAVEに返却し、Tornado.Cashを通じて利益をマネーロンダリングしました。

具体的には、デポジット-ウィズドロー-コレクトフィーズサイクルはいくつかのステップで構成されており、オンラインツール [2]を使用することで、簡単にラベル付けして明確に要約できます。

利益分析

合計で、攻撃者はPopsicle Financeから2000万ドルを不正に取得しました。これには、2.56K WETH、96.2 WBTC、160K DAI、5.39M USDC、4.98M USDT、10.5K UNIが含まれます。 この不正行為の後、攻撃者はまずUniswapとWETHを通じて他のすべてのトークンをETHに交換し、その後Tornado.Cashを使用してマネーロンダリングを行いました。

謝辞

Yufeng Hu、Ziling Lin、Junjie Fei、Lei Wu、Yajin Zhou @BlockSec

(姓のアルファベット順)

https://www.blocksecteam.com

Medium: https://blocksecteam.medium.com/

Twitter: https://twitter.com/BlockSecTeam

連絡先: [email protected]

参考文献

[1] https://twitter.com/defiprime/status/1422708265423556611

[2] https://tx.blocksecteam.com/

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