Back to Blog

[并非所有代币都好] Paraluni 攻击快速分析

Code Auditing
March 13, 2022

Paraluni 项目于 3 月 13 日上午(UTC+8 时间)遭到攻击。攻击者利用了两个漏洞来攻击该协议。第一个漏洞是未验证传入的代币,第二个是传统的重入漏洞。攻击者发起了一系列攻击交易。接下来,我们将使用其中一个交易 0xf2bba649019ce40a67f0fb74e5e800257d359d9094b6ba6faea14ffa4d3446b1 来说明整个攻击过程。

第一步:向 paraRouter 添加 liquidity

攻击者调用了 BTCB-WBNB 池(索引=9)的 addLiquidity,该池将向 UBT(由攻击者创建的代币)铸造 lp 代币。在此操作之后,UBT 代币持有该池的 lp 代币。请注意,BTCB 和 WBNB 是通过闪电贷借入的。

第二步:调用 MasterChefdepositByAddLiquidity 攻击者调用了 depositByAddLiquidity,提供了 _pid 为 9,并将 UGT 和 UBT 代币作为参数。但是,该函数没有检查池的储备代币是否等于传入的代币(UGT 和 UBT)。

然后,该函数调用 depositByAddLiquidityInternal,后者又调用 paraRouter 的 addLiquidity。此函数将调用 UGT 和 UBT 代币的 transferFrom 函数。然而,这两个代币由攻击者控制。在 UBT 的 transferFrom 函数中,攻击者调用了 MasterChef 合约的 deposit 函数,将第一步获得的 LP 代币存入 MasterChef 合约。

不幸的是,由于 deposit 函数中的余额变化,addLiquidity 后的 newBalance 远大于 oldBalance。这样,攻击者在 MasterChef 合约中获得了双倍的信用。

第三步:获利

攻击者最终调用了 UBT.withdrawAssetMasterChef.withdraw 来赎回 lptoken 以获取 BTCB 和 WBNB。由于数量的流动性大于攻击者应有的数量,攻击者将获得利润。

经验

除了重入问题外,传入代币未经验证是根本原因之一。我们已经看到了其他类似的案例,如 Visor 案例Coin98 案例

关于 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/ 官方推特账号:https://twitter.com/BlockSecTeam

Sign up for the latest updates
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.

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

Weekly Web3 Security Incident Roundup | Mar 23 – Mar 29, 2026

This BlockSec weekly security report covers eight DeFi attack incidents detected between March 23 and March 29, 2026, across Ethereum and BNB Chain, with total estimated losses of approximately $1.53M. Incidents include a $679K flawed burn mechanism exploit on the BCE token, a $512K spot-price manipulation attack on Cyrus Finance's PancakeSwap V3 liquidity withdrawal, a $133.5K flash-loan-driven referral reward manipulation on a TUR staking contract, and multiple integer overflow, reentrancy, and accounting error vulnerabilities in DeFi protocols. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Newsletter -  March 2026
Security Insights

Newsletter - March 2026

In March 2026, the DeFi ecosystem experienced three major security incidents. Resolv Protocol lost ~$80M due to compromised privileged infrastructure keys, BitcoinReserveOffering suffered ~$2.7M from a double-minting logic flaw, and Venus Protocol incurred ~$2.15M following a donation attack combined with market manipulation.

Best Security Auditor for Web3

Validate design, code, and business logic before launch. Aligned with the highest industry security standards.

BlockSec Audit