Back to Blog

TransitSwap(およびBabySwap)の盗難資金回収方法

Code Auditing
October 10, 2022

10月1日、BSC上のBabySwapとTransitSwapが攻撃を受けました。一部の攻撃トランザクションは、Botによってフロントランされました。興味深いことに、このBotはprofanityツール脆弱性に対して脆弱であり、私たちはその秘密鍵を正常に回収しました。また、Botコントラクトをリバースエンジニアリングし、Botコントラクトから安全なアカウントに資金を引き出すことに成功しました。資金はTransitSwapに送金済みで、現在BabySwapとの連携を進めている段階です。

BabySwapへの攻撃の検知

2022年10月1日 14:47 (UTC) に、当社の内部システムが攻撃トランザクションを報告しました。その後の分析により、これはスマートルーターコントラクト内の制御されたファクトリーが原因であることが判明しました。しかし、プロジェクトがまだ脆弱であったため、当時は詳細を公開しませんでした。Twitter DMとTGを通じてBabySwapに連絡しましたが、返答はありませんでした。

調査中、このトランザクションはBotアカウントによって発行されたものであり、元の攻撃トランザクションをフロントランしていたことが判明しました。また、このアカウントは8つのゼロで始まるパターンを持っており、profanityツールによって生成されたように見え、profanityツール脆弱性に対して脆弱です。

Botの秘密鍵の回収

2022年10月1日 16:10 (UTC) に、当社のツールは約20分でこのBotの秘密鍵を正常に回収しました。回収した秘密鍵については、資金を安全なアカウントに送金しました(これが当社の救済における典型的なプロセスです)。そうでなければ、秘密鍵を回収した他の者がアカウントを乗っ取り、アカウント内の資金が危険にさらされる可能性があります。

Botからの資金の引き出し

課題は、資金がBotのEOAアカウント自体ではなく、Botがデプロイしたコントラクト内にあることです。資金をどのように引き出すかが課題でした。

コントラクトを逆コンパイルしたところ、コントラクト内に(以下の図に示すように)withdraw関数があることがわかりました。

この関数は、コントラクト内の資金を引き出すために利用できます。最初の引数はトークンアドレス、2番目の引数はゼロであるべきです。

トランザクションを送信し、コントラクトからBotへ正常に資金を引き出し、その後安全なアカウントへ資金を移動しました。

さらなる攻撃が発生!

数時間後、当社のシステムはTransSwapに対する別の攻撃を報告しました。異なるアドレスからの複数の攻撃トランザクションがあり、1つのトランザクションは再びこのBotによってフロントランされました!しかし、Botがデプロイしたコントラクトは異なるものであるため、資金を引き出すための関数も異なります。

資金の返還

内部で協議した結果、以下の理由により、Botではなく攻撃されたプロジェクトに資金を返還することを決定しました。

  • 第一に、資金はBotが脆弱なコントラクトへの攻撃によって取得したものです。Botは攻撃トランザクションをフロントランした(最初に攻撃を開始したわけではない)ものの、攻撃トランザクションのフロントランも攻撃であると考えています。
  • 第二に、資金は攻撃の被害者、すなわち影響を受けたDeFiプロトコルのユーザーに属します。ユーザーはDeFiプロトコルの脆弱性により多大な被害を受けました。彼らは攻撃者からの資金を受け取るべきです。

資金をTransitFinanceの公式資金受取アドレスに送金し、BabySwapに連絡しています

救済のアップデート

私たちはまだ脆弱なアドレスの救済プロセスを進めています。課題は、秘密鍵を回収するまでアドレスが脆弱かどうかを判断できないことです。最適化されたアルゴリズムがあっても、計算能力の限界から、救済を完了するにはまだ時間がかかります。後日、プロセス全体について詳細なレポートを公開し、以下の質問に回答します。

  • 脆弱なアドレスはいくつありますか?
  • 脆弱性の影響はどの程度ですか?つまり、脆弱性によりどれだけの資産がリスクにさらされていますか?
  • この脆弱性に対する攻撃の全体的な状況はどうなっていますか?

続報にご期待ください。安全にお過ごしください。

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