Open hats-bug-reporter[bot] opened 1 year ago
Typo
For example, UST has dropped from $1 to $0, USDT from $1 to $0.95, and USDC from $1 to $0.96.
Hello, Thanks a lot for your attention.
Your assummption is right if only we were'nt using a check on the price feed returned by Chainlink. We mitigate this risk thanks to the deltaAggregatorCvgOracle. In fact, a low % on the deltaAggregator at 0.4% implies that the deposit on the bond will fail if the Chainlink Aggregator returns a price > 1.004$ or price < 0.996$. We have so to consider this issue as Invalid
Github username: @aviggiano Submission hash (on-chain): 0x592934313787dc431b0083ec538078d43faf7165399d7a2b582fa49c41152b37 Severity: medium
Description:
Description
In
CvgOracle.sol:259
, the CvgOracle is not calculating the price of the token when it is a stablecoin. This can be problematic if the stablecoin depegs. For example, UST has dropped from $1 to $0, USDT from $1 to $0.95, and USDC from $0.96.Attack scenario
An attacker can take advantage of this vulnerability when a stablecoin depegs. As the Oracle is not recalculating the stablecoin's price, it will continue to assume it as 1 USD which is no longer its actual price. This can lead to incorrect financial calculations and potential losses to users.
Proof of Concept
The code snippet where the issue is present:
The above code is always setting the token's price to 1 for stablecoins no matter the actual market price.
Recommendation
Use a price feed aggregator for all tokens, including stablecoins, to avoid inaccuracy in price which can potentially lead to financial misrepresentations and losses for users.