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
Building a Secure Stablecoin Payment Network: BlockSec Partners with Morph
Partnership

Building a Secure Stablecoin Payment Network: BlockSec Partners with Morph

BlockSec has partnered with Morph as an official audit partner for the $150M Morph Payment Accelerator. By offering exclusive discounts on smart contract audits and penetration testing, BlockSec provides institutional-grade security to payment builders, ensuring a safe and resilient foundation for the future of global stablecoin payments.

Weekly Web3 Security Incident Roundup | Mar 9 – Mar 15, 2026
Security Insights

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

This BlockSec weekly security report covers eight DeFi attack incidents detected between March 9 and March 15, 2026, across Ethereum and BNB Chain, with total estimated losses of approximately $1.66M. Incidents include a $1.01M AAVE incorrect liquidation caused by oracle misconfiguration, a $242K exploit on the deflationary token MT due to flawed trading restrictions, a $149K exploit on the burn-to-earn protocol DBXen from `_msgSender()` and `msg.sender` inconsistency, and a $131K attack on AM Token exploiting a flawed delayed-burn mechanism. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Venus Thena (THE) Incident: What Broke and What Was Missed

Venus Thena (THE) Incident: What Broke and What Was Missed

On March 15, 2026, an attacker bypassed the THE (Thena) supply cap on Venus Protocol (BNB Chain) through a donation attack, inflating a collateral position to 3.67x the intended limit and borrowing ~$14.9M in assets. Both sides lost money on-chain: Venus was left with ~$2.15M in bad debt after 254 liquidation bots competed across 8,048 transactions, while the attacker retained only ~$5.2M against a $9.92M investment. This deep dive examines what broke across three lines of defense (exposure limits, collateral valuation, and liquidation) and the monitoring gaps that left months of on-chain warning signals unacted upon.

Best Security Auditor for Web3

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

BlockSec Audit