Skip to content
DoS Audit finding Intermediate

Unable to transfer WrappedIbbtc if Oracle go down

The WrappedIbbtc token calls the oracle's pricePerShare function during every transfer and transferFrom, so if that oracle call reverts, users cannot move their tokens at all. The report notes this differs from WrappedIbbtcEth, which uses a cached price and so keeps working when the oracle is unavailable.

gzeon Follow

Originally disclosed on Code4rena

Submitted by gzeon

Impact

In WrappedIbbtc, user will not be able to transfer if oracle.pricePerShare() (L124) revert. This is because balanceToShares() is called in both transfer and transferFrom, which included a call to pricePerShare().

If this is the expected behavior, note that WrappedIbbtcEth is behaving the opposite as it uses the cached value in a local variable pricePerShare, which is only updated upon call to updatePricePerShare().

Recommended Mitigation Steps

Depending on the specification, one of them need to be changed.

dapp-whisperer (BadgerDAO) confirmed

The original report as published on Code4rena, by gzeon. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the transfer path converts balances to shares by calling the live oracle price on every transfer instead of using a cached value, so any oracle failure blocks all transfers.

What the attacker needed

Oracle price call reverts

The fix

The two contracts should be made consistent, either by caching the price as WrappedIbbtcEth does or by changing the other contract, depending on the intended specification.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A token contract sometimes asks an outside service, called an oracle, for a price before it lets someone move tokens. Here that question is asked on every transfer, so if the oracle is broken or refuses to answer, the transfer fails and the tokens are stuck. A safer design keeps a saved copy of the price and only refreshes it occasionally, so ordinary transfers do not depend on the oracle being up.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by gzeon

View all

46 more disclosed reports, best first.

More from BadgerDAO ibBTC Wrapper contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.