Back to Blog

APEエアドロップへのフラッシュローン攻撃の短編分析

Code Auditing
March 17, 2022
3 min read
(画像はBored Ape Yacht ClubのクリエイターがApeCoin暗号トークンを発表(lifestyleasia.com)より)
(画像はBored Ape Yacht ClubのクリエイターがApeCoin暗号トークンを発表(lifestyleasia.com)より)

Will Sheehan氏の報告によると、APEトークンがMEVorによって攻撃されました。分析の結果、APEトークンのエアドロッププロセスがスポット状態のみを考慮するという脆弱性が原因であると考えられ、これは攻撃者によって操作される可能性があります。

具体的には、攻撃者はNFTと交換可能なBYACトークンを借り入れ、それらのNFTを使用してエアドロップを請求できます。その後、攻撃者はBYAC NFTを使用してBYACトークンをミントし、フラッシュローンを返済します。しかし、このプロセスを通じて攻撃者はエアドロップされたAPEトークンを獲得しました。これは、契約が(操作可能な)資産のスポット価格のみを考慮する、フラッシュローンベースの価格操作攻撃に似ていると考えられます。

以下に、このプロセスを攻撃トランザクションを使用して説明します。

ステップI:フラッシュローンの手数料のためにNFTを準備する

NFTの準備
NFTの準備

攻撃者は、攻撃コントラクト 0x77971060 NFT を転送しました。これはフラッシュローンから借りたものではなく、106 ETHで購入されたことに注意してください。

NFTの購入
NFTの購入

ステップII:フラッシュローンを通じてBYACトークンを借りる

BYACトークンの借入
BYACトークンの借入

ステップIII:NFTを使用してAPEトークンを請求する

APEトークンの請求
APEトークンの請求

このプロセス中、攻撃者は6つのNFTを所持していました。1つは購入した1060で、残りの5つは(ステップIIで)借り入れたBYACトークンを使用して交換されたものです。合計で60,564 APEトークンを獲得しました。

ステップIV:NFTをミントしてBYACトークンを取得する

BYACトークンのミント
BYACトークンのミント

攻撃者は6つのNFTをミントしてBYACトークンを取得しました。攻撃者は、フラッシュローンの手数料を支払うために自身のNFT(1060)もミントしたことに注意してください。フラッシュローンを返済した後もBYACトークンが残ったため(自身のBYAC NFT 1060をミントしたため)、攻撃者は残りのBYACトークンを約14 ETHでスワップしました。

BYACトークンのスワップ
BYACトークンのスワップ

利益

合計で、攻撃者は60,564 APEトークンを獲得しました。これは、執筆時点(ブログ記事執筆時)で約500万米ドルの価値がありました。コストはNFT(106 ETH - 14 ETH)で、約27万米ドルでした。

教訓

ここで問題となっているのは、APEトークンのエアドロップが、NFTが誰かによって保有されているかというスポット状態のみを考慮していることだと考えられます。これは、攻撃者がフラッシュローンを使用してスポット状態を操作できるため、脆弱です。フラッシュローンのコストがエアドロップトークンの価値よりも小さい場合、示されたような攻撃機会が生じます。

謝辞

トランザクションを報告したWill Sheehan氏に感謝します。

BlockSecについて

BlockSecは、2021年に世界的に著名なセキュリティ専門家グループによって設立された、先駆的なブロックチェーンセキュリティ企業です。同社は、Web3の普及を促進するために、新たな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
~$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

Best Security Auditor for Web3

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

BlockSec Audit