Back to Blog

CashioAppセキュリティインシデントの再検証

Code Auditing
May 16, 2022
4 min read

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

要約

このインシデントは、Saber LP Arrowsを担保として$CASHトークンのミントとバーンを処理するように設計されたBrrrプログラムのバグに起因していました。具体的には、ユーザーはArrow LPトークンをデポジットすることで$CASH(つまりCASHのミント)を印刷できました。ArrowLPトークンは、基盤となるトークンとして[SaberLPトークン](https://app.saber.so/swap)を受け取ることに注意してください。CASHのミント)を印刷できました。Arrow LPトークンは、基盤となるトークンとして[Saber LPトークン](https://app.saber.so/swap)を受け取ることに注意してください。`CASHをミントできるprint_cash命令は、BankアカウントとCollateralアカウントを含むアカウントのリストを受け取ります。これらは、CASHのミントに使用できる担保(つまりArrowLPトークン)を記録および追跡するために使用されます。設計上、これらの2つのアカウントは管理者によってのみ初期化および承認されるべきです。しかし、プログラムはBankアカウントの有効性をチェックしませんでした。その結果、攻撃者は一連の偽のアカウント(Bankアカウントを含む)を作成してprintcash命令に供給し、ほとんど無料でCASH`のミントに使用できる担保(つまり`Arrow` LPトークン)を記録および追跡するために使用されます。設計上、これらの2つのアカウントは管理者によってのみ初期化および承認されるべきです。しかし、プログラムは`Bank`アカウントの有効性をチェックしませんでした。その結果、攻撃者は一連の偽のアカウント(`Bank`アカウントを含む)を作成して`print_cash`命令に供給し、ほとんど無料で`CASH`を印刷することができました(唯一のコストはトランザクション手数料でした)。

詳細

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

BrrrCommonプログラムのcommon属性(75行目)は、BrrrCommon型の構造体です。BrrrCommonでは、bankアカウントとcollateralアカウントは管理者によって初期化および承認されます。crate_token$CASHトークンのアカウントであり、crate_mintの公開鍵(107行目)、管理者ロールの公開鍵などが含まれます。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は真のアドレスである必要があります。言い換えれば、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の普及を促進するために、新興の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
The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis
Security Insights

The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis

This BlockSec deep-dive analyzes the KelpDAO $290M rsETH cross-chain bridge exploit (April 18, 2026), attributed to the Lazarus Group, tracing a causal chain across three layers: how a single-point DVN dependency enabled the attack, how DeFi composability cascaded the damage through Aave V3 lending markets to freeze WETH liquidity exceeding $6.7B across Ethereum, Arbitrum, Base, Mantle, and Linea, and how the crisis forced decentralized governance to exercise centralized emergency powers. The article examines three parameters that shaped the cascade's severity (LTV, pool depth, and cross-chain deployment count) and provides an exclusive technical breakdown of Arbitrum Security Council's forced state transition, an atomic contract upgrade that moved 30,766 ETH without the holder's signature.

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.

Weekly Web3 Security Incident Roundup | Apr 6 – Apr 12, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Apr 6 – Apr 12, 2026

This BlockSec weekly security report covers four DeFi attack incidents detected between April 6 and April 12, 2026, across Linea, BNB Chain, Arbitrum, Optimism, Avalanche, and Base, with total estimated losses of approximately $928.6K. Notable incidents include a $517K approval-related exploit where a user mistakenly approved a permissionless SquidMulticall contract enabling arbitrary external calls, a $193K business logic flaw in the HB token's reward-settlement logic that allowed direct AMM reserve manipulation, a $165.6K exploit in Denaria's perpetual DEX caused by a rounding asymmetry compounded with an unsafe cast, and a $53K access control issue in XBITVault caused by an initialization-dependent check that failed open. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Best Security Auditor for Web3

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

BlockSec Audit