Back to Blog

Coin98による脆弱性のサイレント修正方法

Code Auditing
January 16, 2022
3 min read

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

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

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

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

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

脆弱性のステルス修正

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

結論

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

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

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
Newsletter - April 2026
Security Insights

Newsletter - April 2026

In April 2026, the DeFi ecosystem experienced three major security incidents. KelpDAO lost ~$290M due to an insecure 1-of-1 DVN bridge configuration exploited via RPC infrastructure compromise, Drift Protocol suffered ~$285M from a multisig governance takeover leveraging Solana's durable nonce mechanism, and Rhea Finance incurred ~$18.4M following a business logic flaw in its margin-trading module that allowed circular swap path manipulatio

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly
Security Insights

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly

This BlockSec weekly security report covers eight attack incidents detected between April 20 and April 26, 2026, across Ethereum, Avalanche, Sui, Base, HyperLiquid, and MegaETH, with total estimated losses of approximately $7.04M. The highlighted incident is the $1.3M GiddyDefi exploit, where the attacker did not break any cryptography or use a flash loan but simply replayed an existing on-chain EIP-712 signature with the unsigned `aggregator` and `fromToken` fields swapped out for a malicious contract, demonstrating how partial signature coverage turns any historical signature into a generic permit. Other incidents include a $3.5M Volo Vault operator key compromise on Sui, a $1.5M Purrlend privileged-role takeover, a $413K SingularityFinance oracle misconfiguration, a $142.7K Scallop cross-pool index injection, a $72.35K Kipseli Router decimal mismatch, a $50.7K REVLoans (Juicebox) accounting pollution, and a $64K Custom Rebalancer arbitrary-call exploit.

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.

Best Security Auditor for Web3

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

BlockSec Audit