Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Invalid

Multiple missing checks while setting the CurveCrvvault

Summary

The setCurveVault function doesn't implement all the needed checks it needs to avoid vulnerabilities

Vulnerability Details

The setCurveVault only implements a zero check as seen here

function setCurveVault(address newVault) external onlyOwner {
require(newVault != address(0), "Invalid vault address");
address oldVault = address(curveVault);
curveVault = ICurveCrvUSDVault(newVault);
emit CurveVaultUpdated(oldVault, newVault);
}

Compare this to the `setStabilityPool` function that implements a zero address check alongside a check making sure that the oldStabilityPool != the new stabilityPool being passed in as a parameter

function setStabilityPool(address newStabilityPool) external onlyOwner {
if (newStabilityPool == address(0)) revert AddressCannotBeZero();
if (newStabilityPool == stabilityPool) revert SameAddressNotAllowed();
address oldStabilityPool = stabilityPool;
stabilityPool = newStabilityPool;
emit StabilityPoolUpdated(oldStabilityPool, newStabilityPool);
}

Impact

This would cause the old CurveVault to still remain and the function would still execute like it's changed

Tools Used

Manual Analysis

Recommendations

Add a check that ensures that oldCurveVault != newCurveVault

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.