Back to Blog

[すべてのトークンが有効とは限らない] パラルニ攻撃の迅速な分析

Code Auditing
March 13, 2022
3 min read

Paraluniプロジェクト(https://twitter.com/paraluni)は、3月13日午前(UTC+8時)に攻撃を受けました。攻撃者は2つの脆弱性を利用してプロトコルを攻撃しました。最初の脆弱性は、渡されたトークンの検証の欠如であり、2番目は一般的なリエントランシーです。攻撃者はいくつかの攻撃トランザクションを実行しました。以下では、そのうちの1つ(0xf2bba649019ce40a67f0fb74e5e800257d359d9094b6ba6faea14ffa4d3446b1)を使用して、攻撃プロセス全体を説明します。

ステップI:paraRouterliquidityを追加

攻撃者はBTCB-WBNBプール(インデックス=9)にaddLiquidityを呼び出し、プールはLPトークンを発行してUBT(攻撃者が作成したトークン)に与えます。この操作の後、UBTトークンはプールのLPトークンを保持します。BTCBとWBNBはフラッシュローンから借りていることに注意してください。

ステップII:MasterChefdepositByAddLiquidityを呼び出す 攻撃者は、_pidを9としてdepositByAddLiquidityを呼び出し、UGTおよびUBTトークンをパラメータとして使用しました。しかし、この関数は、プールの準備トークンが渡されたトークン(UGTおよびUBT)と一致するかどうかをチェックしません。

次に、この関数はdepositByAddLiquidityInternalを呼び出し、それがparaRouteraddLiquidityを呼び出します。この関数は、UGTおよびUBTトークンのtransferFrom関数を呼び出します。しかし、これらの2つのトークンは攻撃者によって制御されています。UBTのtransferFrom関数内で、攻撃者はMasterChefコントラクトのdeposit関数を呼び出し、最初のステップで取得したLPトークンをMasterChefコントラクトに預けました。

残念ながら、deposit関数での残高の変更により、addLiquidity後のnewBalanceoldBalanceよりもはるかに大きくなりました。この方法で、攻撃者はMasterChefコントラクトで二重のクレジットを得ました。

ステップIII:利益を得る

攻撃者は最終的にUBT.withdrawAssetMasterChef.withdrawを呼び出し、LPトークンを償還してBTCBとWBNBを取得しました。流動性の数は攻撃者が持つべき数よりも多いため、攻撃者は利益を得ました。

教訓

リエントランシーの問題に加えて、渡されたトークンが検証されていなかったことが根本原因の1つです。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などの著名な投資家から2回の資金調達で数千万米ドルを受け取っています。

公式ウェブサイト:https://blocksec.com/ 公式Twitterアカウント:https://twitter.com/BlockSecTeam

Sign up for the latest updates
~$15.9M Lost: Trusted Volumes & More | BlockSec Weekly
Security Insights

~$15.9M Lost: Trusted Volumes & More | BlockSec Weekly

This BlockSec bi-weekly security report covers 11 notable attack incidents identified between April 27 and May 10, 2026, across Sui, Ethereum, BNB Chain, Base, Blast, and Berachain, with total estimated losses of approximately $15.9M. Three incidents are analyzed in detail: the highlighted $1.14M Aftermath Finance exploit on Sui, where a signed/unsigned semantic mismatch in the builder-fee validation allowed an attacker to inject a negative fee that was converted into positive collateral during settlement; the $5.87M Trusted Volumes RFQ authorization mismatch on Ethereum; and the $5.7M Wasabi Protocol infrastructure-to-contract-control compromise across multiple EVM chains.

Newsletter - April 2026
Security Insights

Newsletter - April 2026

In April 2026, the DeFi ecosystem experienced three major security incidents. KelpDAO lost ~$290M due to an insecure 1-of-1 DVN bridge configuration exploited via RPC infrastructure compromise, Drift Protocol suffered ~$285M from a multisig governance takeover leveraging Solana's durable nonce mechanism, and Rhea Finance incurred ~$18.4M following a business logic flaw in its margin-trading module that allowed circular swap path manipulatio

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

Best Security Auditor for Web3

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

BlockSec Audit