Platform: Code4rena
Start Date: 29/03/2024
Pot Size: $36,500 USDC
Total HM: 5
Participants: 72
Period: 5 days
Judge: 3docSec
Total Solo HM: 1
Id: 357
League: ETH
Rank: 50/72
Findings: 1
Award: $8.28
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: immeas
Also found by: 0xAkira, 0xCiphky, 0xGreyWolf, 0xJaeger, 0xMosh, 0xabhay, 0xlemon, 0xmystery, 0xweb3boy, Aamir, Abdessamed, Aymen0909, Breeje, DanielArmstrong, DarkTower, Dots, EaglesSecurity, FastChecker, HChang26, Honour, IceBear, JC, K42, Krace, MaslarovK, Omik, OxTenma, SAQ, Shubham, Stormreckson, Tigerfrake, Tychai0s, VAD37, ZanyBonzy, albahaca, arnie, ast3ros, asui, b0g0, bareli, baz1ka, btk, caglankaan, carrotsmuggler, cheatc0d3, dd0x7e8, grearlake, igbinosuneric, jaydhales, kaden, kartik_giri_47538, m4ttm, ni8mare, niser93, nonn_ac, oualidpro, pfapostol, pkqs90, popeye, radev_sw, samuraii77, slvDev, zabihullahazadzoi
8.2807 USDC - $8.28
There exists a variable, uint256 public constant MINIMUM_OUSG_PRICE = 105e18;
The point of this is as a minimum price to be returned by the oracle.
Any price returned by this oracle that is below the value 105e18 will cause the price feed to revert as shown below
function getOUSGPrice() public view returns (uint256 price) { (price, ) = oracle.getPriceData(); require( price > MINIMUM_OUSG_PRICE, "OUSGInstantManager::getOUSGPrice: Price unexpectedly low" ); }
this is a problem because the oracle returns the price in terms of usdc or 6 decimals. The incorrect assumption was that the returned price would be 18 decimals. This is confirmed by the function getOUSGPrice
nat spec which states the following...
- @notice Returns the current price of OUSG in USDC
The oracle will return the price in usdc, because of such a decimal differential between OUSG and USDC decimals, the price will always be below the minimum of 105e18, causing the function to always revert. Furthermore this variable is constant and can never be changed so the function will be dosed without any way to fix it.
The getOUSGPrice
function is essential to the contract, it is called in the functions below
_mint
_redeem
Becuase this variable cannot be changed and it paramount to the functionality of the protocol, i believe this is a high severity issue.
ousg instant manager will be dosed forever because of wrong minimum price assumptions
getOUSGPrice
manual review
change the minimum to be in the decimals of usdc example
uint256 public constant MINIMUM_OUSG_PRICE = 105e6;
DoS
#0 - c4-pre-sort
2024-04-04T04:33:55Z
0xRobocop marked the issue as duplicate of #245
#1 - c4-judge
2024-04-09T13:01:21Z
3docSec changed the severity to QA (Quality Assurance)
#2 - c4-judge
2024-04-09T13:02:01Z
3docSec marked the issue as grade-b