Back to Blog

Loopring (LRC) プロトコルインシデント

Code Auditing
December 3, 2020

2020年11月、イーサリアム上の多くのDeFiプラットフォームで、Pickle Finance88mphなどのセキュリティインシデントが発生しました。

DeFiで発生したセキュリティインシデントを検知するために、私たちはThunderForecastシステムを開発しました。最近のトランザクションを分析する際に、極めて疑わしいトランザクションのクラスを発見しました。まず、取引レートの差が千倍以上ある取引のペアが存在します。次に、呼び出し元(EOA)は、各トランザクションの最後に常に少量のEtherを獲得できます。私たちは、私たちの研究チームが開発したEthScopeシステムを使用してこれらのトランザクションを分析し、これがアービトラージ目的でLoopringのVaultプロトコルの脆弱性を悪用した攻撃であることを発見しました。

LRCプロトコル手数料Vault

Loopringは、イーサリアムブロックチェーン上の分散型取引所(DEX)のためのオープンソースプロトコルです。対応するLRCは、Loopringのトークン(ERC-20)です。さらに、Loopringはプロトコルの手数料を保管するための特定のVaultプロトコル(LRC Protocol Fee Vault)を持っています。以下では、略称LRCPFVを使用します。

    function sellTokenForLRC(
        address token,
        uint    amount
        )
        external
        nonReentrant
    {
        require(amount > 0, "ZERO_AMOUNT");
        require(token != lrcAddress, "PROHIBITED");

        address recipient = tokenSellerAddress == address(0) ? owner : tokenSellerAddress;

        if (token == address(0)) {
            recipient.sendETHAndVerify(amount, gasleft());
        } else {
            token.safeTransferAndVerify(recipient, amount);
        }

        require(
            tokenSellerAddress == address(0) ||
            ITokenSeller(tokenSellerAddress).sellToken(token, lrcAddress),
            "SELL_FAILURE"
        );

        emit TokenSold(token, amount);
    }

sellTokenForLRCはLRCPFV内の関数です。この関数により、ユーザーはプールから手数料をLRCトークンにスワップできます。しかし、開発者によってsellTokenForLRCにアクセス制御が設計されていないため、誰でもこの関数を呼び出すことができます。最終的に、この脆弱性を悪用することで、攻撃者は同じロジックで一連の攻撃を開始する機会を得ます。攻撃の詳細については、以下で分析します。

詳細

攻撃トランザクション0x00b2c...を用いて、この攻撃のより詳細な情報を明らかにします。

これには6つのステップが含まれます。

  • ステップ1:0xEB7e...から3773.88 ETHのフラッシュローンを借り入れます。

  • ステップ2:Uniswap V1-LRCで3773.88 ETHを5014.68 LRCにスワップします。この取引のレートは1 ETH = 1.32878 LRCです。

  • ステップ3:LRCFVに保管されている0.231 ETHの手数料を、sellTokenForLRCを呼び出すことによってUniswap V1-LRCプールで0.000219 LRCにスワップします(前述の通り、攻撃者はsellTokenForLRCを呼び出すべきではありません)。しかし、Uniswap V1-LRCで使用されている価格計算アルゴリズムに基づき、Uniswap V1-LRCでのLRCとETHの価格は劇的に上昇します。この取引のレートは1 ETH = 0.00094 LRCです。

  • ステップ4:Uniswap V1-LRCで5014.68 LRCを3774.09 ETHにスワップします。ステップ3に基づき、Uniswap V1-LRCでスワップされたLRCはわずかです。このアクションにより、Uniswap V1-LRCでのETHに対するLRCの価値が高まります。したがって、ステップ1と比較して、攻撃者はUniswap V1-LRCで5014.68 LRCをスワップして3773.88 ETHを獲得し、追加で0.215 ETHの利益を得ます。

  • ステップ5:3773.88 ETHのフラッシュローンを返済します。

  • ステップ6:0.215 ETHを攻撃者のアドレス(EOA)に送信します。

損益

分析されたトランザクションは2020年10月13日に実行されました。攻撃者と被害者の双方の粗いながらも説明可能な損益を計算するために、coingeckoを使用してLRCの価格(0.0005175 ETH)を取得します。一方、LRCPFV。

攻撃者はステップ4で価格を操作し、2回の取引で0.215 ETHの利益を得ます。

攻撃の規模

攻撃の特徴に基づき、攻撃者0x81e8...によってローンチされた3つのデプロイされた悪意のあるコントラクト(0xa896...0x414a...0xd91d...)と90のトランザクションを検知しました(LRCPFVがデプロイされたブロック9644449以降。例えば、トランザクション0x33eab...での最大の利益は9.89 ETHに達しました)。最終的に、攻撃者は合計80.97 ETHをアービトラージし、これは2020年10月1日時点の価格に基づき48,849.2 USDに相当します。

終わりに

イーサリアムでのDeFiエコシステムの発展に伴い、様々なセキュリティ問題が徐々に顕在化しています。しかし、コミュニティは、莫大な金銭的損失をもたらす攻撃に容易に惹きつけられがちですが、目立たない攻撃も見過ごされがちです。実際、この攻撃の根本原因であるアクセス制御は、90件のトランザクションをローンチすることによってLoopringに相当な損失(80.97ETH)をもたらしました。

タイムライン

  • 2020/11/30:疑わしいトランザクションが発見されました。
  • 2020/12/01:分析を完了しました。
  • 2020/12/02:loopringに報告しました。
  • 2020/12/03:脆弱性が確認され、修正がオンラインになりました。
  • 2020/12/03:詳細が公開されました。
  • 2021/01/03:CVE-2020–35962が割り当てられました。
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