Back to Blog

より少なく預けて、より多くを得る:yCREDIT攻撃の詳細

Code Auditing
January 3, 2021

2021年1月2日(北京時間午前7時25分)、当社の監視システムThunderForecastは、yCREDITスマートコントラクトに対する一連の不正なトランザクションを報告しました。その後、当社の研究チームが開発したEthScopeシステムを使用してこれらのトランザクションを分析し、報告されたすべてのトランザクションが悪意のあるものであることを確認しました。本ブログでは、攻撃の詳細を説明します。

詳細

この攻撃は、ミントされたトークンの数が意図された数と一致しないことに起因します。そのため、攻撃者はより低価格でより多くのyCREDITトークンを入手することができます。これらのトークンは利益を得るために売却されます。

脆弱な関数は、StableYieldCreditコントラクト_deposit関数にあります。

以下では、攻撃トランザクションを使用して、プロセス全体を説明します。

攻撃者はまず、1e-8 WBTC331.335 yCreditトークンをWBTC-yCREDITペアプールに転送しました。その後、攻撃者は0.5 WBTCStableYieldCreditコントラクトにデポジットして攻撃を開始しました。

具体的には、token(0x2260fac5e5542a773aa44fbcfedf7c193bc2c599 - WBTC)のamount(0.5)を、価格オラクルプロバイダーChainLink(480行目、_value1466786010075)に基づいて使用して_valueが計算されます。これは、デポジットされたWBTCのUSDでの価値を計算することを意図しています。その後、コントラクトは、WBTCをデポジットした者(攻撃者)に、yCREDITトークン(_value - fee)の数を転送します。これは、yCREDITの価値が1 USDに等しい(システムによって設計された通り)ためです。すべて問題ありませんが、攻撃者は少額のfeeを失います。

さらに、コントラクトはデポジットされたWBTCをWBTC-yCREDITペアプールに追加します。これは、デポジットされたWBTCがコントラクトにロックされると流動性を失うためです。そのため、まずプールに入れられるトークンペア(WBTCからyCREDIT)の価値が計算されます。この価値は_addLiquidity関数を使用して計算されます。基本的に、これはプール内の既存の準備金に基づいて計算されます。プールには1e-8 WBTC331.335 yCREDITトークンしかありません。そのため、計算されたamountA44amountB1466786010075)となります。これは、攻撃者が44e-8 WBTC(485行目)しか使用せず、14667.86010075 - fee = 14594.52080025 yCREDITトークン(493行目)を入手したことを意味します。同時に、プールには少量のWBTC(1e-8 + 44e-8)と(331.335 + 14667.86010075)yCREDITトークンが残ります。

利益を得るために、攻撃者は得られた14594.52080025 yCREDITトークンを取引所で売却できます。興味深いことに、このトランザクションで利益を得るプロセスは、必要以上に複雑です。他のトランザクションでも巧妙な攻撃戦略を観察しています。

攻撃には、以下を含む一連のトランザクションが関与しています(ただし、これらに限定されません)。

更新

2020/01/03:脆弱性を修正した新しいスマートコントラクトがあります。

タイムライン

  • 2021/01/01 23:25 UTC、当社のシステムによって攻撃が捕捉されました。
  • 2021/01/02 16:20 UTC、本ブログが公開されました。
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