Open c4-bot-5 opened 7 months ago
0xRobocop marked the issue as duplicate of #250
0xRobocop marked the issue as duplicate of #156
3docSec marked the issue as satisfactory
3docSec changed the severity to QA (Quality Assurance)
3docSec marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2024-03-ondo-finance/blob/be2e9ebca6fca460c5b0253970ab280701a15ca1/contracts/ousg/ousgInstantManager.sol#L230 https://github.com/code-423n4/2024-03-ondo-finance/blob/be2e9ebca6fca460c5b0253970ab280701a15ca1/contracts/ousg/ousgInstantManager.sol#L254 https://github.com/code-423n4/2024-03-ondo-finance/blob/be2e9ebca6fca460c5b0253970ab280701a15ca1/contracts/ousg/ousgInstantManager.sol#L335 https://github.com/code-423n4/2024-03-ondo-finance/blob/be2e9ebca6fca460c5b0253970ab280701a15ca1/contracts/ousg/ousgInstantManager.sol#L362
Vulnerability details
Impact
The amount of
OUSG
andrOUSG
tokens a user gets upon minting is highly dependent on the price ofOUSG
as gotten from the oracle, which is updated based on the transactions. This causes that a user looking to mint with a certain amount ofUSDC
has no control of the amount of tokens he gets in return. This opens up the users to various griefing vectors through sandwich attacks, MEVs, as they can be frontrun and receive worse prices than expected when they initially submitted the transaction. The same goes for redemptions, users can redeemOUSG
andrOUSG
for way lessUSDC
than they were intially expecting, especially when there are large price movements. This is because there's no available slippage protection, no minimum return amount or deadline for the trade transaction to be valid which means the trade can be delayed by miners or users congesting the network, as well as being sandwich attacked - ultimately leading to loss of user funds.The
mint
,mintRebasingOUSG
,redeem
, andredeemRebasingOUSG
functions lack a deadline check, subjecting users' transaction to be on hold for longer periods by malicious miners, and lack aminAmountOut
parameter, opening users up to sandwich attacks and loss of funds.Proof of Concept
OUSG
tokens for 150_000USDC
at 150USDC
perOUSG
;OUSG
dropping the price to 120_000USDC
;USDC
Tools Used
Manual code review
Recommended Mitigation Steps
Add a minimum return amount and a deadline that users can specify upon minting and redemption.
Assessed type
MEV