Back to Blog

三殊犬安全事件分析

Code Auditing
July 21, 2021

7月21日,我们的DeFiRanger系统报告了几笔可疑交易。经过人工分析,我们确认这些交易是针对Sanshu Inu的攻击。具体来说,Sanshu Inu的Memstake合约被滥用deflation机制所攻击。 接下来,我们将通过多笔攻击交易来阐述攻击过程。

攻击流程

下图列出了攻击者(0x333)发起的一些交易。

攻击包含四个步骤,其中最关键的是第二步,它利用了ERC20代币的通缩机制来操纵Memstake智能合约的奖励计算。

  • 步骤1(准备):攻击者创建了两个攻击合约,第一个合约用于质押2049B的KEANU第二个是攻击合约。

  • 步骤2(操纵):攻击者首先通过闪电贷(《理解闪电贷及其在DeFi生态系统中的应用:迈向第一步》(SBC 2021))从uniswapV2 借入大量KEANU代币,然后使用步骤1中创建的第二个智能合约将代币存入/从中提取。由于KEANU具有通缩机制,每次交易会销毁2%的代币,因此实际存入Memestake的代币数量小于Memestake合约维护的user.amount值。攻击者重复此过程,使得Memestake中的KEANU代币数量减少到很小的数量(1e-07)。请参见交易0x00ed和下图。

  • 步骤3(获利):攻击者调用 Memestake.updatePool() 来更新 accMfundPerShare。该值依赖于KEANU代币的数量(在第二步中被操纵)。然后,攻击者获得了大量的Mfund(约6100万)。 有关更多详细信息,请参阅交易0xa945
  • 步骤4(兑换为WETH):攻击者将MFund和KEANU兑换为WETH,并通过Tornado.Cash洗钱。攻击者获得了55.9484578158357 ETH的利润。

杂项

有趣的是,攻击的第二/第三步与Flashbots有关。第二步用38 ETH购买KEANU(0x00ed)。该交易受到“沙盒攻击”(通过Flashbots)的攻击——这使得攻击者本人也成为了“沙盒攻击”的受害者。第三步(0xa945)在uniswap上出售MFund,这创造了一个套利机会,被Flashbots的搜索者捕获。

关于BlockSec

BlockSec是一家开创性的区块链安全公司,成立于2021年,由一群全球顶尖的安全专家组成。公司致力于提升新兴Web3世界的安全性和可用性,以促进其大规模采用。为此,BlockSec提供智能合约和EVM链安全审计服务,用于安全开发和主动威胁拦截的Phalcon平台,用于资金追踪和调查的MetaSleuth平台,以及供Web3构建者在加密世界高效冲浪的MetaDock扩展。

迄今为止,公司已为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
Tether Freezes $6.76M USDT Linked to Iran's IRGC & Houthi Forces: Why On-Chain Compliance is Now a Geopolitical Battlefield
Security Insights

Tether Freezes $6.76M USDT Linked to Iran's IRGC & Houthi Forces: Why On-Chain Compliance is Now a Geopolitical Battlefield

Looking ahead, targeted freezing events like this $6.76M USDT action will only become more common. On-chain data analysis is improving. Stablecoin issuers are also working closely with regulators. As a result, hidden illicit financial networks will be exposed.

Weekly Web3 Security Incident Roundup | Mar 2 – Mar 8, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Mar 2 – Mar 8, 2026

During the week of March 2 to March 8, 2026, seven blockchain security incidents were reported with total losses of ~$3.25M. The incidents occurred across Base, BNB Chain, and Ethereum, exposing critical vulnerabilities in smart contract business logic, token deflationary mechanics, and asset price manipulation. The primary causes included a double-minting logic flaw during full token deposits that allowed an attacker to exponentially inflate their balances through repeated burn-and-mint cycles, a price manipulation vulnerability in an AMM-based lending market where artificially inflated vault shares created divergent price anchors to incorrectly force healthy positions into liquidation, and a flawed access control implementation relying on trivially spoofed contract interfaces that enabled attackers to bypass authorization to batch-mint and dump arbitrary tokens.

Weekly Web3 Security Incident Roundup | Feb 23 – Mar 1, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Feb 23 – Mar 1, 2026

During the week of February 23 to March 1, 2026, seven blockchain security incidents were reported with total losses of ~$13M. The incidents affected multiple protocols, exposing critical weaknesses in oracle design/configuration, cryptographic verification, and core business logic. The primary drivers included oracle manipulation/misconfiguration that led to the largest loss at YieldBloxDAO (~$10M), a crypto-proof verification flaw that enabled the FOOMCASH (~$2.26M) exploit, and additional token design and logic errors impacting Ploutos, LAXO, STO, HedgePay, and an unknown contract, underscoring the need for rigorous audits and continuous monitoring across all protocol layers.