Back to Blog

Loopring(LRC) Protocol Incident

Code AuditingPhalcon SecurityMetaSleuth
December 3, 2020
4 min read
Key Insights
  • Critical access control flaw in Loopring’s LRC Protocol Fee Vault (sellTokenForLRC) let anyone trigger token sales, enabling price manipulation

  • Attack combined flash loans with unauthorized vault swaps to distort Uniswap V1-LRC pricing, then arbitrage

Hash(ti)(mod2248)=[b0,b1,,b247]T,where bi{0,1}\text{Hash}(t_i) \pmod{2^{248}} = [b_0, b_1, \dots, b_{247}]^T, where\ b_i \in \{0, 1\}

In November 2020, a critical vulnerability in Loopring’s LRC Protocol Fee Vault allowed attackers to exploit access control weaknesses and manipulate token prices via flash loan attacks. This incident highlights the importance of robust access control and continuous DeFi security monitoring to prevent costly exploits.

Introduction to the Loopring (LRC) Protocol Incident

In late 2020, several Ethereum-based DeFi platforms, including Pickle Finance and 88mph, experienced security incidents. To detect such vulnerabilities, BlockSec developed the ThunderForecast system, which identified suspicious transactions involving unusually large trade rate differences and consistent Ether gains by the same external owned account (EOA).

Using our EthScope system, we analyzed these transactions and discovered an exploit targeting a vulnerability in Loopring’s vault protocol, specifically the LRC Protocol Fee Vault (LRCPFV). This blog post details the attack, its impact, and lessons learned for the DeFi security community.


LRC Protocol Fee Vault Overview

Loopring is an open-source decentralized exchange (DEX) protocol on Ethereum. Its native token, LRC (ERC-20), is used within the ecosystem. Loopring’s vault protocol, known as the LRC Protocol Fee Vault (LRCPFV), stores protocol fees and allows swapping fees to LRC tokens.

The vulnerable function in LRCPFV is sellTokenForLRC, which enables swapping tokens for LRC without proper access control, allowing anyone to invoke it.

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);
}

Because this function lacks access control, attackers could repeatedly invoke it to manipulate token prices and profit from arbitrage opportunities.


Details of the Attack

We analyzed a representative attack transaction: 0x00b2c.... The attack involved six key steps:

  1. Flash Loan: Borrowed 3,773.88 ETH from a flash loan provider (0xEB7e...).
  2. Initial Swap: Converted 3,773.88 ETH to 5,014.68 LRC on Uniswap V1-LRC at a rate of 1 ETH = 1.32878 LRC.
  3. Fee Vault Swap: Swapped 0.231 ETH fee stored in LRCPFV to 0.000219 LRC by invoking the vulnerable sellTokenForLRC function. This unauthorized call manipulated the LRC price on Uniswap, drastically increasing its value against ETH (1 ETH = 0.00094 LRC).
  4. Profitable Swap: Swapped 5,014.68 LRC back to 3,774.09 ETH on Uniswap V1-LRC, gaining an extra 0.215 ETH due to the manipulated price.
  5. Loan Repayment: Returned the 3,773.88 ETH flash loan.
  6. Profit Transfer: Sent the 0.215 ETH profit to the attacker’s EOA.

This exploit leveraged a flash loan attack combined with price manipulation and lack of access control in the vault contract.


Impact and Scale of the Attack

The analyzed transaction occurred on October 13, 2020. Using CoinGecko data, the LRC price was approximately 0.0005175 ETH at that time.

Our investigation uncovered:

  • Malicious Contracts: 3 deployed by the attacker (0xa896..., 0x414a..., 0xd91d...).
  • Attack Volume: 90 transactions launched by the attacker’s EOA (0x81e8...) since block 9,644,449, where LRCPFV was deployed.
  • Maximum Profit: One transaction (0x33eab...) yielded 9.89 ETH profit.
  • Total Profit: Approximately 80.97 ETH (~48,849 USD as of October 1, 2020).

The root cause was the missing access control in the sellTokenForLRC function, enabling repeated exploitation.


Get Started with Phalcon Security

Detect every threat, alert what matters, and block attacks.

Try now for free

Lessons Learned and The End

As the Ethereum DeFi ecosystem grows, security challenges such as access control vulnerabilities become increasingly critical. While high-profile attacks often grab attention, less conspicuous vulnerabilities can cause significant financial losses, as demonstrated by this incident.

Loopring lost approximately 80.97 ETH due to this exploit, emphasizing the need for rigorous smart contract audits and continuous security monitoring.

For DeFi protocols, implementing strict access control, leveraging tools like BlockSec’s Smart Contract Audit and Phalcon Security, and proactive risk management are essential to safeguard digital assets.


Explore MetaSleuth Investigation

Trace flows and build evidence for investigations

Try now for free

Timeline of the Incident

  • 2020/11/30: Suspicious transactions detected by ThunderForecast.
  • 2020/12/01: Completed detailed analysis using EthScope.
  • 2020/12/02: Reported vulnerability to Loopring team.
  • 2020/12/03: Vulnerability confirmed; fix implemented.
  • 2020/12/03: Public disclosure of incident details.
  • 2021/01/03: CVE-2020-35962 assigned to the vulnerability.

References and Further Reading

Sign up for the latest updates
Web3 Attack Surfaces: A Penetration Testing Overview
Security Services

Web3 Attack Surfaces: A Penetration Testing Overview

Crypto institutions keep every traditional attack surface and add the money-handling chain on top of it. This article gives testers a practical abstraction of the running system: a four-component model—Application, Authorization and Signing, Blockchain Interaction, and Infrastructure—with each component's responsibility, representative implementations, and inherited attack surfaces. It then structures web3-specific coverage into five attack-surface areas, from production and automation operations through signing intent, approval and withdrawal chains, and fund logic to on-chain transactions and deployed contracts.

~$23M Lost: Cosmos EVM, Moonwell Exploits | BlockSec Weekly
Security Insights

~$23M Lost: Cosmos EVM, Moonwell Exploits | BlockSec Weekly

During the reporting period (2026/08/22 - 2026/08/30), we cover 5 blockchain security incidents totaling approximately $22.7M in losses; an estimated $74M-$119.5M was drained from Tectonic, most of it erased when Cronos was rolled back to its pre-exploit state. The highlight is a six-chain Cosmos EVM exploit series (~$5.7M realized), traced on TAC Chain, where a shared balance-synchronization bug chained an underflow and an overflow to drain a staking pool. The report also analyzes Moonwell's combined collateral-accounting and oracle price manipulation, Tectonic's combined oracle-price and receipt-token exchange-rate manipulation of low-liquidity collateral, an Ajna liquidation business-logic flaw, and a Rain Card Contract Exploit Series with an Ed25519 signature-verification bypass (Avici, Tria, and others) on Solana.

Rules of Engagement and Production Safety for Institutional Blockchain Penetration Testing
Security Services

Rules of Engagement and Production Safety for Institutional Blockchain Penetration Testing

A penetration test that touches signing, withdrawal, and ledger systems is prepared before it runs. This article follows the engagement lifecycle: turning a business decision into objective, scope, named owners, and authorized access; recording authority, permitted techniques, operating limits, prohibited activity, communications, and evidence handling in a Rules of Engagement document; and protecting live service with measurable stop criteria, monitoring, change coordination, and named pause authority. It closes with the remediation and retest that turn findings into validated controls.

Best Security Auditor for Web3

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

BlockSec Audit

Get Real-Time Protection with Phalcon Security

Audits alone are not enough. Phalcon Security detects attacks in real time and blocks threats mid-flight.

phalcon security

Go Deeper with MetaSleuth Investigation

Extend your crypto compliance capabilities with Blocksec's MetaSleuth Investigation, the first platform for tracing funds, mapping transaction networks and revealing hidden on-chain relationships.

Move from detection to resolution faster with clear visual insights and evidence-ready workflows across the digital assets ecosystem.

MetaSleuth Investigation