Seal Finance 安全事件

Seal Finance 安全事件

在11月30日,我们的安全事件监控系统ThunderForecast通过扫描以太坊上的历史交易,发现了一起针对Loopring协议的攻击(中文博客:https://zhuanlan.zhihu.com/p/328707244)。最终结论是,此次攻击的根本原因在于sellTokenForLRC函数缺乏访问控制。攻击者利用了80.97枚ETH,按照当时的价格计算,相当于48,849.2美元。

2020年12月11日,我们的监控系统ThunderForecast报告了一系列交易,其交易汇率异常。随后,我们使用团队开发的EthScope系统来分析这些交易,并发现这是一起利用Seal Finance Protocol的漏洞进行套利的攻击。

什么是Seal?

在Seal的白皮书中提到:“SEAL——一个实验性协议,作为主要DeFi协议代币之间的中介,从而在它们之间创造更深的流动性。”截至目前,已有10多个流动性池将Seal与其他不同的知名代币(如UNIYFIUSDTSNX等)连接起来。要获得奖励,投资者需要将LP代币存入SEAL奖励合约,并触发Farm合约中的breed()函数来生成新的SEAL代币。Farm合约部署在每个Seal池中,合约中的breed()函数用于发行新的Seal代币。根据breed()的设置,它额外发行1.6%的Seal代币。此外,0.8%的已发行Seal代币兑换成另一种代币,并与另外0.8%的已发行Seal代币一起作为流动性存入池中。然而,由于breed()函数未设计访问控制,任何人都可以触发该函数,这一原始设计成为了此次报告攻击的根本原因。

以下是breed()函数的已确认源代码:

function breed() external {
	require(now / 1 days > today);
	today += 1;
 
	uint256 sealPairAmount = seal.balanceOf(address(cSeal));
	uint256 tokenPairAmount = token.balanceOf(address(cSeal));
	uint256 newSeal = sealPairAmount.mul(spawnRate).div(1e18);
	uint256 amount = UniswapV2Library.getAmountOut(newSeal, sealPairAmount, tokenPairAmount);
 
	seal.mint(address(cSeal), newSeal);
	if(address(seal) < address(token))
    	cSeal.swap(0, amount, address(this), "");
	else
    	cSeal.swap(amount, 0, address(this), "");
	token.transfer(address(cSeal), amount);
	seal.mint(address(cSeal), newSeal);
	cSeal.mint(address(this));
}

细节

我们现在开始披露此次攻击的更多细节,其中一次攻击交易包含了多达10个Seal池的攻击逻辑。在下面的分析中,我们重点关注Seal-SNX池中的攻击。

此次攻击涉及三个步骤:

  • 步骤1:在Seal-SNX池中将1,084枚Seal兑换为2,787枚SNX。交易汇率为:1 Seal = 2.57 SNX。
  • 步骤2:触发Farm合约中的breed()函数。此函数发行13.08枚Seal并将其兑换为10.20枚SNX。此时的交易汇率为:1 SNX = 0.78 Seal。这是因为池中大部分SNX已兑换成Seal,导致SNX和Seal的数量之间出现巨大差异。然后,根据Uniswap的价格计算算法,SNX在池中的价值变得极高(价格上涨超过3倍)。
  • 步骤3:在Seal-SNX池中将2,787枚SNX兑换为1,100枚Seal。由于此次兑换进一步推高了SNX的价格,攻击者套利出更多的Seal代币(额外16枚Seal)。

为了进一步衡量和确认损失,我们使用EthScope系统在攻击发生前的区块状态下重放了breed()函数。结果显示,与正常调用相比,Farm额外发行了18枚Seal代币。攻击者拿走了16枚Seal,池中只剩下2枚Seal。

收益与损失

在这次交易中,攻击者总共获得了175枚Seal。

攻击规模

截至2020年12月13日,链上已部署3个恶意合约(0x49f93e0x8b37100x0f20b6),共成功发动了22笔交易,消耗了4,247枚Seal代币。根据当时的价格,攻击者通过利用Seal协议的漏洞获得了约58,467美元。值得注意的是,Seal协议的漏洞仍在被攻击!!!

此外,通过分析获得的Seal代币的流向,我们发现约有900枚Seal代币被存入DEX,其余的被分发到6个不同的地址。如下图所示,这些地址除了Seal Finance和Uniswap V2的流动性池之外,都是Seal代币的主要持有者。

结束语

随着以太坊DeFi生态系统的发展,各种安全问题逐渐显现。事实上,攻击的根本原因——访问控制,导致Seal在截至2020年12月13日的22笔交易中遭受了(58,467美元)的重大损失。

更新 (2021/01/04)

在2020年11月30日的首次攻击后,攻击者部署了第三个攻击合约并发动了五次攻击。最近一次攻击发生在2020年12月24日,将获得的Seal代币转至该地址[)。在此过程中,攻击者获得了6,021枚Seal代币。

时间线:

  • 2020/12/11:发现可疑交易
  • 2020/12/12:完成分析
  • 2020/12/13:报告给Seal Finance
  • 2021/01/03:发布细节
  • 2021/01/03:分配CVE-2021–3006

关于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
Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

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

During the week of February 9 to February 15, 2026, three blockchain security incidents were reported with total losses of ~$657K. All incidents occurred on the BNB Smart Chain and involved flawed business logic in DeFi token contracts. The primary causes included an unchecked balance withdrawal from an intermediary contract that allowed donation-based inflation of a liquidity addition targeted by a sandwich attack, a post-swap deflationary clawback that returned sold tokens to the caller while draining pool reserves to create a repeatable price-manipulation primitive, and a token transfer override that burned tokens directly from a Uniswap V2 pair's balance and force-synced reserves within the same transaction to artificially inflate the token price.

Top 10 "Awesome" Security Incidents in 2025

Top 10 "Awesome" Security Incidents in 2025

To help the community learn from what happened, BlockSec selected ten incidents that stood out most this year. These cases were chosen not only for the scale of loss, but also for the distinct techniques involved, the unexpected twists in execution, and the new or underexplored attack surfaces they revealed.

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

On August 29, 2025, Panoptic disclosed a Cantina bounty finding and confirmed that, with support from Cantina and Seal911, it executed a rescue operation on August 25 to secure roughly $400K in funds. The issue stemmed from a flaw in Panoptic’s position fingerprint calculation algorithm, which could have enabled incorrect position identification and downstream fund risk.