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

Best Security Auditor for Web3

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

BlockSec Audit