Skip to content

Beautiful Fossilized Griffin - Oracle validation bypass enables price manipulation & DoS #1470

@sherlock-admin2

Description

@sherlock-admin2

Beautiful Fossilized Griffin

Medium

Oracle validation bypass enables price manipulation & DoS

Summary

  • Unsafe int256 -> uint256 casting in _getLatestPrice() method(in MixedPriceOracleV4.sol), this will cause massive fund loss for protocol users, as malicious oracles will return negative prices that convert to astronomical positive values.
  • missing zero-price validation will cause the system halt for all users as faulty oracles will return 0 prices that trigger division-by-zero reverts.

Root Cause

Internal Pre-conditions

  • eOracle/Api3 feed needs to return negative int256 price value to set eOraclePrice/apiV3Price to be less than 0
  • eOracle feed needs to return zero price to set eOraclePrice to be exactly 0

External Pre-conditions

  • API3/eOracle needs to return negative price value due to malfunction, data corruption, system error, or network issues
  • eOracle network needs to experience downtime, causing price to default to 0

Attack Path

  • Attacker manipulates one oracle to return negative price, another to return zero
  • Attacker first exploits the negative price bug to gain massive collateral
  • Attacker then triggers the division by zero bug to prevent liquidations
  • Attacker withdraws stolen funds while liquidation system is disabled
  • Protocol suffers maximum damage - funds stolen AND system frozen

Impact

The protocol suffers total fund drainage. The attacker gains unlimited borrowing against worthless collateral.
It also can't process any price-dependent operations (minting, borrowing, liquidations) for affected markets. Users cannot access their funds or perform any trading activities until oracle feeds are restored.

PoC

No response

Mitigation

// Validate prices are positive before casting int256 -> uint256 in _getLatestPrice()
require(apiV3Price > 0, "API3 price must be positive");
require(eOraclePrice > 0, "eOracle price must be positive");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions