Back to Blog

カシオアプリのセキュリティインシデント再訪

Code Auditing
May 16, 2022

2022年3月23日 16:20:08 UTC+8に開始されたCashioAppは、約5200万ドルの損失で担保トークンアカウントを枯渇させるように悪用されました。このハッキングは、攻撃者が預け入れなしで200億ドルの$CASHトークンを鋳造することを可能にする、入力アカウントの不十分なチェックによって実現されました。以下に技術的な詳細を示します。

概要

このインシデントは、Saber LP Arrowsを担保として$CASHトークンの鋳造と燃焼を処理するように設計されたBrrrプログラムのバグが原因でした。具体的には、ユーザーはArrow LPトークンを預け入れることで$CASHを印刷(つまり鋳造)できます。Arrow LPトークンが基盤となるトークンとしてSaber LPトークンを受け取ることに注意してください。$CASHを鋳造できるprint_cash命令は、BankアカウントやCollateralアカウントを含むアカウントのリストを受け取ります。これらは、$CASHの鋳造に使用されることを許可された担保(つまりArrow LPトークン)を記録および追跡するために使用されます。設計上、これら2つのアカウントは管理者によってのみ初期化および承認される必要があります。しかし、プログラムはBankアカウントの有効性をチェックしません。その結果、攻撃者は一連の偽のアカウント(Bankアカウントを含む)を作成し、print_cash命令にフィードして、ほとんど無料で$CASHを印刷することができます(唯一のコストはトランザクション手数料です)。

詳細

まず、以下のprint_cash命令で使用されるアカウントの分析から始めましょう。

属性common(75行目)は、プログラム内のBrrrCommon型の構造体です。BrrrCommonでは、bankアカウントとcollateralアカウントは管理者によって初期化および承認されます。crate_tokenは、$CASHトークンのアカウントであり、crate_mintの公開鍵(107行目)、管理者ロールの公開鍵など、$CASHに関する情報を格納します。crate_collateral_tokensは、ユーザーから転送された担保トークンを保持するボルトアカウントです。担保はArrow LPトークンである必要があり、これはSaberのLPトークンを受け取るため、ユーザーはsaber_swapの関連アカウントを入力する必要があります。BrrrCommon構造体の最後の2つの属性は、命令で使用されるターゲットプログラムのプログラムIDです。PrintCash構造体の最後の4つの属性は、ユーザーのシステムアカウント(トランザクションの署名者でもある)、ユーザーの担保アカウント、鋳造された$CASHを受け取るユーザーの$CASHトークンアカウント、および$CASHを鋳造する権限を持つアカウントの公開鍵です。

攻撃トランザクション

上記アカウントの機能を理解した後、攻撃トランザクション:0x4fgL…z2K5を分析します。この攻撃は、攻撃者アドレス(0x6D7fにあります)から開始され、PrintCash命令の入力アカウントのリストは以下のとおりです。

Account #10x5aha)はBankアカウントに対応します。これは、CashioAppの公式ウェブサイト(0xEm1P)で提供されているアドレスとは異なることに注意してください。これは、Bankアカウントの検証が不十分であることを意味します!

検証

コード内のBrrrCommon構造体の検証を詳しく見て、バイパスがどのように機能するかを理解しましょう。

入力Bankアカウントに対する唯一のチェックは、入力されたCollateralアカウントがBankアカウントに関連付けられていることを確認することです(12行目)。しかし、偽のCollateralアカウントを提供することでも簡単にバイパスできます。さらに、実際の担保資産の支払いを避けるために、攻撃者は偽のsaber_swapアカウントも提供しました。攻撃者は価値のない担保資産を預け入れて価値のある$CASHトークンを印刷することを目的としているため、攻撃者によって提供されるcrate_tokencrate_mintは実際の(true)アドレスである必要があります。言い換えれば、Bankアカウントの検証が不十分であるため、攻撃者は一連の偽のアカウントを作成して、価値のない担保で$CASHを印刷することができます。

修正

修正は、assert_keys_eq!(self.bank.crate_mint, self.crate_mint)ステートメントを追加することです。このステートメントは、Bankアカウントのcrate_mint$CASHの正しいcrate_mintであることを保証します。しかし、それはBankアカウントが有効であることをどのように保証するのでしょうか?bankmanプログラムのNewBank構造体とcrate_tokenプログラムのNewCrate構造体を見て答えを見つけましょう。

実際には、Bankアカウントは、シードにcrate_tokenのアドレスを含むPDAです。一方、crate_tokenは、シードにcrate_mintのアドレスを含むPDAです。これにより、入力されたcrate_mintが有効であれば、Bankアカウントは有効であることが保証されます。正しいcrate_mintがなければ、攻撃者は$CASHを鋳造できず、攻撃を起動できません。

BlockSecについて

BlockSecは、2021年に世界的に著名なセキュリティ専門家グループによって設立された先駆的なブロックチェーンセキュリティ企業です。同社は、新興のWeb3世界のためのセキュリティとユーザビリティの向上に専念しており、その大規模な採用を促進しています。この目的のため、BlockSecはスマートコントラクトとEVMチェーンのセキュリティ監査サービス、セキュリティ開発と脅威のプロアクティブなブロックのためのPhalconプラットフォーム、資金追跡と調査のためのMetaSleuthプラットフォーム、およびWeb3ビルダーが暗号世界を効率的にサーフィンするためのMetaSuites拡張機能を提供しています。

現在までに、同社は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
Tether Freezes $6.76M USDT Linked to Iran's IRGC & Houthi Forces: Why On-Chain Compliance is Now a Geopolitical Battlefield
Security Insights

Tether Freezes $6.76M USDT Linked to Iran's IRGC & Houthi Forces: Why On-Chain Compliance is Now a Geopolitical Battlefield

Looking ahead, targeted freezing events like this $6.76M USDT action will only become more common. On-chain data analysis is improving. Stablecoin issuers are also working closely with regulators. As a result, hidden illicit financial networks will be exposed.

Weekly Web3 Security Incident Roundup | Mar 2 – Mar 8, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Mar 2 – Mar 8, 2026

During the week of March 2 to March 8, 2026, seven blockchain security incidents were reported with total losses of ~$3.25M. The incidents occurred across Base, BNB Chain, and Ethereum, exposing critical vulnerabilities in smart contract business logic, token deflationary mechanics, and asset price manipulation. The primary causes included a double-minting logic flaw during full token deposits that allowed an attacker to exponentially inflate their balances through repeated burn-and-mint cycles, a price manipulation vulnerability in an AMM-based lending market where artificially inflated vault shares created divergent price anchors to incorrectly force healthy positions into liquidation, and a flawed access control implementation relying on trivially spoofed contract interfaces that enabled attackers to bypass authorization to batch-mint and dump arbitrary tokens.

Weekly Web3 Security Incident Roundup | Feb 23 – Mar 1, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Feb 23 – Mar 1, 2026

During the week of February 23 to March 1, 2026, seven blockchain security incidents were reported with total losses of ~$13M. The incidents affected multiple protocols, exposing critical weaknesses in oracle design/configuration, cryptographic verification, and core business logic. The primary drivers included oracle manipulation/misconfiguration that led to the largest loss at YieldBloxDAO (~$10M), a crypto-proof verification flaw that enabled the FOOMCASH (~$2.26M) exploit, and additional token design and logic errors impacting Ploutos, LAXO, STO, HedgePay, and an unknown contract, underscoring the need for rigorous audits and continuous monitoring across all protocol layers.