Back to Blog

Coin98が脆弱性を静かに修正する方法

Code Auditing
January 16, 2022

先週金曜日、当社の監視システムは、BSC上のCoin98スマートコントラクト(0x8aaf408e06feed6a6a6182ea3c464035748b9b31 - 被害者コントラクト)に対する攻撃を検知しました。直ちにTwitter経由でプロジェクトオーナーにDMを送りましたが、返信はありませんでした。当時、脆弱性はまだ存在していたため、公開しませんでした。その後数時間後、プロジェクトオーナーが脆弱性を修正した新しいコントラクトを作成したことが判明しました。そのため、ここで脆弱性と修正についてまとめることが安全であると判断しました。

攻撃トランザクションと根本原因

当社の内部監視システムによって提起されたトランザクションが私たちの注意を引きました。慎重な調査の結果、swapExactTokensForTokens関数におけるrouteパラメータ(つまりルーター)のアクセス制御に起因することを確認しました。以下にそのコードを示します。

このコントラクトはrouteを盲目的に信頼し、ルーターのswapExactTokensForTokens関数を呼び出しました。これに先立ち、被害者コントラクトが所有するすべてのトークンをrouteに承認しました。しかし、routeは攻撃者によって侵害される可能性がありました。この場合、攻撃者は被害者コントラクトが所有するすべてのトークンを自身に転送し、WBNBと交換して利益を得ることができました。

以下は、攻撃トランザクションの例です。

脆弱性のステルス修正

先週金曜日にTwitterでプロジェクトオーナーにDMを送りましたが、返信はありませんでした。その後、本日コントラクトを再確認したところ、新しいスマートコントラクト(0x83f25d16bdf91f51120032f264dad0e1ab1c8227)がデプロイされていることがわかりました。この新しいコントラクトには、routeのためのホワイトリストがあります。

結論

スマートコントラクトが渡されたパラメータを盲目的に信頼するというケースを数多く見てきました。これは深刻なセキュリティホールを生み出します。

制御外のパラメータを信頼しないでください!

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
Tracing $1.6B in TRON USDT: Inside the VerilyHK Ponzi Infrastructure
Case Studies

Tracing $1.6B in TRON USDT: Inside the VerilyHK Ponzi Infrastructure

An on-chain investigation into VerilyHK, a fraudulent platform that moved $1.6B in TRON USDT through a multi-layered fund-routing infrastructure of rotating wallets, paired payout channels, and exchange exit funnels, with traced connections to the FinCEN-sanctioned Huione Group.

Weekly Web3 Security Incident Roundup | Mar 30 – Apr 5, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Mar 30 – Apr 5, 2026

This BlockSec weekly security report covers nine DeFi attack incidents detected between March 30 and April 5, 2026, across Solana, BNB Chain, Arbitrum, and Polygon, with total estimated losses of approximately $287M. The week was dominated by the $285.3M Drift Protocol exploit on Solana, where attackers combined multisig signer social engineering with Solana's durable nonce mechanism to bypass a zero-timelock 2-of-5 Security Council, alongside notable incidents including a $950K flash loan TWAP manipulation against the LML staking protocol, a $359K Silo Finance vault inflation via an external `wstUSR` market donation exploiting a depegged-asset oracle and `totalAssets()` accounting flaw, and an EIP-7702 delegated-code access control failure. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident, covering flawed business logic, access control, price manipulation, phishing, and misconfiguration attack types.

Drift Protocol Incident: Multisig Governance Compromise via Durable Nonce Exploitation
Security Insights

Drift Protocol Incident: Multisig Governance Compromise via Durable Nonce Exploitation

On April 1, 2026 (UTC), Drift Protocol on Solana suffered a $285.3M loss after an attacker exploited Solana's durable nonce mechanism to delay the execution of phished multisig approvals, ultimately transferring administrative control of the protocol's 2-of-5 Squads governance with zero timelock. With full admin privileges, the attacker created a malicious collateral market (CVT), inflated its oracle price, relaxed withdrawal protections, and drained USDC, JLP, SOL, cbBTC, and other assets through 31 rapid withdrawals in approximately 12 minutes. This incident highlights how durable nonce-based delayed execution can decouple signer intent from on-chain execution, bypassing the temporal assumptions that multisig security implicitly relies on.

Best Security Auditor for Web3

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

BlockSec Audit