Back to Blog

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

Code Auditing
January 16, 2022
2 min read

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

攻击交易与根本原因

我们内部监控系统检测到的交易引起了我们的注意。经过仔细调查,我们确认这是由于 swapExactTokensForTokens 函数中 route 参数(即路由,实际含义)的访问控制不当所致,如下所示:

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

以下是其中一次攻击交易:

漏洞的隐匿修复

上周五,我们通过 Twitter 私信联系了项目方,但未收到回复。今天我们再次检查合约,发现已部署了一个新的智能合约(0x83f25d16bdf91f51120032f264dad0e1ab1c8227)。这个新合约为 route 添加了白名单:

结论

我们见过许多合约盲目信任传入参数的案例。这确实会造成严重的 arehole。

请勿信任任何不受控的参数!

关于 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
~$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.

The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis
Security Insights

The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis

This BlockSec deep-dive analyzes the KelpDAO $290M rsETH cross-chain bridge exploit (April 18, 2026), attributed to the Lazarus Group, tracing a causal chain across three layers: how a single-point DVN dependency enabled the attack, how DeFi composability cascaded the damage through Aave V3 lending markets to freeze WETH liquidity exceeding $6.7B across Ethereum, Arbitrum, Base, Mantle, and Linea, and how the crisis forced decentralized governance to exercise centralized emergency powers. The article examines three parameters that shaped the cascade's severity (LTV, pool depth, and cross-chain deployment count) and provides an exclusive technical breakdown of Arbitrum Security Council's forced state transition, an atomic contract upgrade that moved 30,766 ETH without the holder's signature.

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