「セーフティトランスファー」が危険になる時:QBridgeセキュリティインシデントから学ぶ教訓

「セーフティトランスファー」が危険になる時:QBridgeセキュリティインシデントから学ぶ教訓

1月28日、QBRIDGEが攻撃を受け、約8000万米ドル相当の資産が盗難されました。分析の結果、コードにおける根本原因はsafeTransfer(およびsafeTransferFrom)関数の実装にあることが判明しました。

根本原因

まず、プロジェクトではトークン転送に広く使われているOpenZeppelin SafeERC20ライブラリを使用していません。代わりに、SafeTokenというライブラリを独自に実装しました。

次に、実装では宛先が有効なコントラクトであるか(あるいはゼロアドレスでないか)のチェックを行っていません。

第三に、EVMの低レベルコールでは、宛先コントラクトがゼロアドレスの場合にfalseを返しません。 これは開発者の常識に反します。

もちろん、このインシデントには、例えばゼロアドレスがホワイトリストに入れられたといった他の理由もいくつかあります。しかし、コードがこの特別なケースを適切に処理できていれば、脆弱性はありませんでした。

ちなみに:類似のコードを使用している他のプロジェクトも存在します。それらも同様の問題の影響を受ける可能性があります。

実験

VMが宛先コントラクトがゼロアドレスの場合にfalseを返さないという3番目の理由を確認するために、以下に示すテストコントラクトを開発しました。

TestSafeTransfer.test()の実行はリバートしません。

教訓とリスク軽減策

以下の点を推奨します。

  • 非常に非常に正当な理由がない限り、独自の車輪を再発明するのではなく、広く使われているライブラリを使用してください。
  • 資産転送の前後に残高をチェックし、転送された資産の数量が期待値と一致していることを確認してください。これは、デフレ・インフレトークンの問題も回避できます。

BlockSecについて

BlockSecは、2021年に世界的に著名なセキュリティ専門家グループによって設立された、先駆的なブロックチェーンセキュリティ企業です。当社は、新興の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
Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

During the week of February 9 to February 15, 2026, three blockchain security incidents were reported with total losses of ~$657K. All incidents occurred on the BNB Smart Chain and involved flawed business logic in DeFi token contracts. The primary causes included an unchecked balance withdrawal from an intermediary contract that allowed donation-based inflation of a liquidity addition targeted by a sandwich attack, a post-swap deflationary clawback that returned sold tokens to the caller while draining pool reserves to create a repeatable price-manipulation primitive, and a token transfer override that burned tokens directly from a Uniswap V2 pair's balance and force-synced reserves within the same transaction to artificially inflate the token price.

Top 10 "Awesome" Security Incidents in 2025

Top 10 "Awesome" Security Incidents in 2025

To help the community learn from what happened, BlockSec selected ten incidents that stood out most this year. These cases were chosen not only for the scale of loss, but also for the distinct techniques involved, the unexpected twists in execution, and the new or underexplored attack surfaces they revealed.

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

On August 29, 2025, Panoptic disclosed a Cantina bounty finding and confirmed that, with support from Cantina and Seal911, it executed a rescue operation on August 25 to secure roughly $400K in funds. The issue stemmed from a flaw in Panoptic’s position fingerprint calculation algorithm, which could have enabled incorrect position identification and downstream fund risk.