Back to Blog

Coin98 如何悄无声息地修复漏洞

Code Auditing
January 16, 2022

上周五,我们的监控系统检测到针对 Coin98(0x8aaf408e06feed6a6a6182ea3c464035748b9b31 - 受害合约)在 BSC 上的智能合约的攻击。我们立即通过 Twitter 私信项目方,但未收到回复。由于当时漏洞依然存在,我们并未公开。几小时后,我们发现项目方已部署新合约,修复了该漏洞。因此,我们现在可以安全地总结该漏洞和修复方案。

攻击交易和根本原因

我们内部监控系统上报的交易引起了我们的注意。经过仔细调查,我们确认这是由于 swapExactTokensForTokens 函数中 route 参数(即路由)的访问控制问题,具体如下:

该合约盲目信任 route 参数,然后调用路由器的 swapExactTokensForTokens 函数。在此之前,它为 route 批准了受害合约拥有的所有代币。然而,route 参数可以由攻击者传递。在这种情况下,攻击者可以将受害合约的所有代币转移给自己,然后兑换成 WBNB 以获利。

以下是攻击交易之一。

漏洞的隐蔽修复

上周五,我们通过 Twitter 私信项目方,但未收到回复。今天我们再次检查合约,发现已部署了一个新的智能合约(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 等知名投资者那里获得了数千万美元的投资。

官方网站: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