Blackhan Software Disclosed Report

Oracle failure due to `address(1)` hardcoded source tokens

Created date
May 17 2025

Target

https://github.com/blackhan-software/xpower-banq/tree/5f734cc14fd05afcf7ee221de0bb600f8ca2339c

Vulnerability Details

The oracle implementations (Oracle_000, Oracle_001, etc.) use address(1) representing USD as the source token for some feeds.

These oracles fail completely because any call to initialize a _twap value through Oracle.refresh() ends up trying to set decimals via _unitOf(source), where the decimalsOf() staticcall returns false for address(1), reverting the call.

Oracle implementations Oracle_000, Oracle_001, and Oracle_002 will all have broken feeds.

AVAX_USD.getAskToken(), USD_AVAX.getBidToken(), USDC_USD.getAskToken(), USD_USDC.getBidToken(), USDT_USD.getAskToken(), USD_USDT.getBidToken() all return address(1).

When the oracle implementations are deployed, they call _enlist() to set the whitelisted feeds.

  • Oracle_000.sol: _enlist(usd_avax.bidToken(), usd_avax.askToken(), usd_avax, FOR_1Y); sets 0x1 for source token address in _feed.
  • Oracle_001.sol: _enlist(usd_usdc.bidToken(), usd_usdc.askToken(), usd_usdc, FOR_1Y); sets 0x1 for source token address in _feed.
  • Oracle_002.sol: _enlist(usd_usdt.bidToken(), usd_usdt.askToken(), usd_usdt, FOR_1Y); sets 0x1 for source token address in _feed.

Validation steps

Any user who wants an updated _twap for example calls Oracle.refresh(0x1, 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7).

This calls Oracle.retwap(0x1, 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7).

This calls _unitOf(0x1) which calls Token.unitOf(0x1), which ends up calling Token.decimalsOf(0x1), which does 0x1.staticcall(), returning false with no data and reverting with InvalidDecimals(0x1).

This disallows _twap quote values from ever being set for these feeds.

New feed contract's would need to be coded with different value than address(1), or special considerations to return default value for address(1) source token would be needed.

CommentsReport History
Comments on this report are hidden
Details
Statedisclosed
Severity
Medium
Bounty$500
Visibilitypartially
VulnerabilityDoS with (Unexpected) revert
Participants (4)
company admin
company admin
author
triage team