Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

T1MOH - StableOracleWBTC use BTC/USD chainlink oracle to price WBTC which is problematic if WBTC depegs #202

Closed
sherlock-admin opened this issue May 23, 2023 · 5 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Escalation Resolved This issue's escalations have been approved/rejected Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented May 23, 2023

T1MOH

medium

StableOracleWBTC use BTC/USD chainlink oracle to price WBTC which is problematic if WBTC depegs

Summary

The chainlink BTC/USD oracle is meant to be used to price WBTC (but it is blocked by another issue: wrong address of btc/usd priceFeed now is used). WBTC is basically a bridged asset and if the bridge is compromised/fails then WBTC will depeg and will no longer be equivalent to BTC. This will lead to large amounts of borrowing against an asset that is now effectively worthless. Since the protocol still values it via BTC/USD the protocol will not only be stuck with the bad debt caused by the currently outstanding loans but they will also continue to give out bad loans and increase the amount of bad debt further

Vulnerability Detail

Impact

Protocol will take on a large amount of bad debt should WBTC bridge become compromised and WBTC depegs

Code Snippet

https://github.com/sherlock-audit/2023-05-USSD/blob/main/ussd-contracts/contracts/oracles/StableOracleWBTC.sol#L8-L27

Tool used

Manual Review

Recommendation

I would recommend using a double oracle setup. Use both the Chainlink and another on-chain liquidity base oracle (i.e. UniV3 TWAP). If the price of the on-chain liquidity oracle drops below a certain threshold of the Chainlink oracles (i.e. 2% lower), any borrowing should be immediately halted. The chainlink oracle will prevent price manipulation and the liquidity oracle will safeguard against the asset depegging.

Duplicate of #310

@github-actions github-actions bot closed this as completed Jun 5, 2023
@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jun 5, 2023
@github-actions github-actions bot added High A valid High severity issue and removed Medium A valid Medium severity issue labels Jun 23, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jun 23, 2023
@T1MOH593
Copy link

Escalate for 10 USDC

Not a duplicate of #817
It talks about danger of assuming BTC is equal to WBTC

@sherlock-admin
Copy link
Contributor Author

Escalate for 10 USDC

Not a duplicate of #817
It talks about danger of assuming BTC is equal to WBTC

You've created a valid escalation for 10 USDC!

To remove the escalation from consideration: Delete your comment.

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

@sherlock-admin sherlock-admin added the Escalated This issue contains a pending escalation label Jun 23, 2023
@ctf-sec
Copy link
Collaborator

ctf-sec commented Jul 1, 2023

See comments in #675

@hrishibhat
Copy link
Contributor

hrishibhat commented Jul 14, 2023

Result:
Medium
Duplicate of #310

@sherlock-admin
Copy link
Contributor Author

sherlock-admin commented Jul 14, 2023

Escalations have been resolved successfully!

Escalation status:

@hrishibhat hrishibhat added Medium A valid Medium severity issue and removed High A valid High severity issue labels Jul 14, 2023
@sherlock-admin sherlock-admin added Escalation Resolved This issue's escalations have been approved/rejected and removed Escalated This issue contains a pending escalation labels Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Escalation Resolved This issue's escalations have been approved/rejected Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

4 participants