Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

ge6a - The 'Dollar price too low' check may be insufficient under certain circumstances #229

Closed
sherlock-admin opened this issue Jan 10, 2024 · 2 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Jan 10, 2024

ge6a

medium

The 'Dollar price too low' check may be insufficient under certain circumstances

Summary

In the event of a depeg of DAI and a suitable distribution of collateral tokens in the protocol, the check for the minimum price of the Ubiquity Dollar token may not be triggered, leading to potential harm to users during minting.

Vulnerability Detail

The function getTwapPrice() returns the price of 1 Ubiquity Dollar token measured in 3pool tokens. In the mintDollar function, there is a check whether this price is >= the pre-defined mintPriceThreshold. The goal is to prevent minting in this case because subsequent calculations assume that the price of the Ubiquity Dollar token is 1 USD. The issue with this workflow is that both the Ubiquity Dollar token and the 3pool token are dependent on the price of DAI. DAI constitutes over 50% of the 3pool pool in Curve. Additionally, DAI can be used as collateral for the Ubiquity Dollar token, thus influencing its price. In the event of a depeg of DAI and a suitable distribution of collateral tokens for the Ubiquity Dollar token, market prices for both the Ubiquity Dollar token and the 3pool token could fall below 1.

In this case, the expected behavior is for the check for the minimum acceptable price of the Ubiquity Dollar token to be triggered during minting, leading to the suspension of minting. However, due to the correlation between the two tokens from the Curve pool used to determine the price (Ubiquity Dollar token and 3pool token), this may not occur. As a result, users could be adversely affected by receiving Ubiquity Dollar tokens of lower value than the collateral they deposited.

Impact

Bypassing a crucial check during minting could result in financial losses for the user.

Code Snippet

https://github.com/sherlock-audit/2023-12-ubiquity/blob/d9c39e8dfd5601e7e8db2e4b3390e7d8dff42a8e/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L326-L386

Tool used

Manual Review

Recommendation

An idea for a solution is to add an additional check to verify whether the price of the 3pool token is >= 1, possibly using an oracle.

Duplicate of #17

@github-actions github-actions bot added the Excluded Excluded by the judge without consulting the protocol or the senior label Jan 14, 2024
@sherlock-admin2
Copy link
Contributor

1 comment(s) were left on this issue during the judging contest.

auditsea commented:

Not required

@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 and removed Excluded Excluded by the judge without consulting the protocol or the senior labels Jan 16, 2024
@sherlock-admin2
Copy link
Contributor

1 comment(s) were left on this issue during the judging contest.

auditsea commented:

Not required

@sherlock-admin sherlock-admin changed the title Acrobatic Champagne Turkey - The 'Dollar price too low' check may be insufficient under certain circumstances ge6a - The 'Dollar price too low' check may be insufficient under certain circumstances Jan 24, 2024
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jan 24, 2024
@Czar102 Czar102 removed the Medium A valid Medium severity issue label Feb 14, 2024
@sherlock-admin sherlock-admin added Non-Reward This issue will not receive a payout and removed Reward A payout will be made for this issue labels Feb 14, 2024
@Czar102 Czar102 added the Medium A valid Medium severity issue label Feb 19, 2024
@sherlock-admin sherlock-admin added Reward A payout will be made for this issue and removed Non-Reward This issue will not receive a payout labels Feb 19, 2024
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 Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

3 participants