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

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

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
Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

During the week of February 9 to February 15, 2026, three blockchain security incidents were reported with total losses of ~$657K. All incidents occurred on the BNB Smart Chain and involved flawed business logic in DeFi token contracts. The primary causes included an unchecked balance withdrawal from an intermediary contract that allowed donation-based inflation of a liquidity addition targeted by a sandwich attack, a post-swap deflationary clawback that returned sold tokens to the caller while draining pool reserves to create a repeatable price-manipulation primitive, and a token transfer override that burned tokens directly from a Uniswap V2 pair's balance and force-synced reserves within the same transaction to artificially inflate the token price.

Top 10 "Awesome" Security Incidents in 2025

Top 10 "Awesome" Security Incidents in 2025

To help the community learn from what happened, BlockSec selected ten incidents that stood out most this year. These cases were chosen not only for the scale of loss, but also for the distinct techniques involved, the unexpected twists in execution, and the new or underexplored attack surfaces they revealed.

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

On August 29, 2025, Panoptic disclosed a Cantina bounty finding and confirmed that, with support from Cantina and Seal911, it executed a rescue operation on August 25 to secure roughly $400K in funds. The issue stemmed from a flaw in Panoptic’s position fingerprint calculation algorithm, which could have enabled incorrect position identification and downstream fund risk.