code-423n4 / 2023-01-ondo-findings

0 stars 0 forks source link

Centralization risk #340

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Lines of code

https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L821

Vulnerability details

Impact

MANAGER_ADMIN can set a very high value for minimumRedeemAmount which will ensure that all attempt to redeem amount simply fails

Proof of Concept

  1. User A wants to redeem amount 100000 using the requestRedemption function

  2. Before User A can do so, MANAGER_ADMIN simply updates the minimumRedeemAmount to 100001 using the setRedeemMinimum function

function setRedeemMinimum(
    uint256 newRedeemMinimum
  ) external onlyRole(MANAGER_ADMIN) {
    uint256 oldRedeemMin = minimumRedeemAmount;
    minimumRedeemAmount = newRedeemMinimum;
    emit MinimumRedeemAmountSet(oldRedeemMin, minimumRedeemAmount);
  }
  1. User A transaction fails since amountCashToRedeem < minimumRedeemAmount
 if (amountCashToRedeem < minimumRedeemAmount) {
      revert WithdrawRequestAmountTooSmall();
    }

Recommended Mitigation Steps

Add a max cap for minimumRedeemAmount which will prevent such scenarios

c4-judge commented 1 year ago

trust1995 marked the issue as unsatisfactory: Out of scope