现实中的操纵价格攻击(又来了):RariCapital事件

现实中的操纵价格攻击(又来了):RariCapital事件

5月8日, Peckshield 报告了 Rari Capital 的一起安全事件。经过仔细调查,我们发现这是一种我们论文中描述的价格操纵攻击(间接操纵)。该论文标题为:“DeFiRanger: Detecting Price Manipulation Attacks on DeFi Applications”。在论文中,我们专注于检测 DeFi 应用上的两种新型攻击,包括直接和间接价格操纵攻击。前者意味着攻击者通过攻击易受攻击的 DeFi 应用,在同一个去中心化交易所(DEX)中执行不受欢迎的交易,从而直接操纵代币价格。后者意味着攻击者间接操纵易受攻击的 DeFi 应用的代币价格。此次安全事件是间接价格操纵攻击的一个例子。

根本原因

我们分析了攻击的根本原因,发现不安全的价格依赖是原因所在。具体来说,Rari 的 LP 代币价格取决于 Rari 持有的 LP 代币 ibEth 的价值(以以太计)。不幸的是,ibEth LP 代币的价格可以通过调用 ibEth 的 work 函数来操纵。

攻击者持有的 Rari 代币价值 = Rari 中的以太储备 * Rari 代币数量 / Rari 代币总供应量

Rari 持有的 ibEth 代币价值 = ibEth 中的以太储备 * ibEth 代币数量 / ibEth 代币总供应量

Rari 中的以太储备受到 Rari 持有的 ibEth 代币价值的影响,而 ibEth 代币价值又通过增加 ibEth 中的以太储备(通过调用 work 函数)来被攻击者操纵。

使用我们的 DefiRanger 系统,我们可以轻松恢复图中显示的 DeFi 语义。在流动性挖矿(存入以太获取 LP 代币)和流动性取消(提取 LP 代币获取以太)中,LP 代币的数量(用红色圆圈标出)与相同的以太数量(用绿色背景标出)是不同的。

攻击过程

攻击过程如下:

  1. 攻击者调用 ibEth 的 work 函数。
  2. 该函数调用 SushiswapGoblin.work 函数,该函数进一步调用了攻击者控制的合约(0x2f755e8980f0c2e81681d82cccd1a4bd5b4d5d46)。
  1. 合约首先将 58903.4755276693 以太(从闪电贷借入)存入 Rari,并获得 Rari 的 LP 代币(146281892117489076580650)。
  2. 攻击者向 ibEth 存入 3818.9022134987213 以太。这是关键步骤,它将提高 ibEth LP 代币的价格(而不影响其总供应量)。这会进一步影响 Rari 的 LP 代币价格。这是因为 Rari 池中的总以太储备因其持有的 ibEth LP 代币价格上涨而增加。请注意,攻击者无法通过添加流动性来操纵 Rari 或 ibEth 的代币价格,因为这也会增加代币的总供应量。
  3. 攻击者提取以太。由于 Rari 代币的价格更高,攻击者可以使用更少的 Rari LP 代币(146196247321127203315331,而不是 146281892117489076580650)来获取相同数量的以太以归还闪电贷。
  1. 攻击者在 work 函数的最后获得归还的以太。

总结

总而言之,Rari Capital 面临的安全漏洞 starkly 提醒我们,DeFi 应用面临着复杂的威胁。通过巧妙的利用策略,攻击者执行了间接价格操纵攻击。此次事件揭示了智能合约中使用不安全价格依赖的关键漏洞。此次攻击凸显了 DeFi 项目迫切需要采用像 DeFiRanger 这样的强大检测系统,以防范威胁新兴 DeFi 生态系统完整性和安全性的直接和间接操纵策略。

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