Back to Blog

デポジットを減らして、より多くをゲット:yCREDIT攻撃の詳細

Code Auditing
January 3, 2021
2 min read

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

詳細

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

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

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

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

具体的には、_valueは、価格オラクルプロバイダーChainLink(480行目、_value1466786010075)に基づいて、token(0x2260fac5e5542a773aa44fbcfedf7c193bc2c599 - WBTC)のamount(0.5)を使用して計算されます。これは、デポジットされたWBTCのUSDでの価値を計算することを意図しています。その後、コントラクトはyCREDITトークンの数(_value - fee)をWBTCをデポジットした人(攻撃者)に転送します。これは、yCREDITの価値が1USD(システムによって設計された通り)に等しいためです。攻撃者が少額の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
The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis
Security Insights

The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis

This BlockSec deep-dive analyzes the KelpDAO $290M rsETH cross-chain bridge exploit (April 18, 2026), attributed to the Lazarus Group, tracing a causal chain across three layers: how a single-point DVN dependency enabled the attack, how DeFi composability cascaded the damage through Aave V3 lending markets to freeze WETH liquidity exceeding $6.7B across Ethereum, Arbitrum, Base, Mantle, and Linea, and how the crisis forced decentralized governance to exercise centralized emergency powers. The article examines three parameters that shaped the cascade's severity (LTV, pool depth, and cross-chain deployment count) and provides an exclusive technical breakdown of Arbitrum Security Council's forced state transition, an atomic contract upgrade that moved 30,766 ETH without the holder's signature.

Weekly Web3 Security Incident Roundup | Apr 13 – Apr 19, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Apr 13 – Apr 19, 2026

This BlockSec weekly security report covers four attack incidents detected between April 13 and April 19, 2026, across multiple chains such as Ethereum, Unichain, Arbitrum, and NEAR, with total estimated losses of approximately $310M. The highlighted incident is the $290M KelpDAO rsETH bridge exploit, where an attacker poisoned the RPC infrastructure of the sole LayerZero DVN to fabricate a cross-chain message, triggering a cascading WETH freeze across five chains and an Arbitrum Security Council forced state transition that raises questions about the actual trust boundaries of decentralized systems. Other incidents include a $242K MMR proof forgery on Hyperbridge, a $1.5M signed integer abuse on Dango, and an $18.4M circular swap path exploit on Rhea Finance's Burrowland protocol.

Weekly Web3 Security Incident Roundup | Apr 6 – Apr 12, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Apr 6 – Apr 12, 2026

This BlockSec weekly security report covers four DeFi attack incidents detected between April 6 and April 12, 2026, across Linea, BNB Chain, Arbitrum, Optimism, Avalanche, and Base, with total estimated losses of approximately $928.6K. Notable incidents include a $517K approval-related exploit where a user mistakenly approved a permissionless SquidMulticall contract enabling arbitrary external calls, a $193K business logic flaw in the HB token's reward-settlement logic that allowed direct AMM reserve manipulation, a $165.6K exploit in Denaria's perpetual DEX caused by a rounding asymmetry compounded with an unsafe cast, and a $53K access control issue in XBITVault caused by an initialization-dependent check that failed open. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Best Security Auditor for Web3

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

BlockSec Audit