58081 sc medium missing check in function alchemistv3 setminimumcollateralization could lead to set minimumcollateralization globalminimumcollateralization

Submitted on Oct 30th 2025 at 13:42:18 UTC by @sol_4th05 for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #58081

  • Report Type: Smart Contract

  • Report severity: Medium

  • Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/AlchemistV3.sol

  • Impacts:

    • Contract fails to deliver promised returns, but doesn't lose value

Description

Brief/Intro

The minimumCollateralization could be set to be > globalMinimumCollateralization when it should not be allowed. Therefore, all the functions using these parameters would use values that should not be allowed by the framework of the AlchemistV3. Because of the onlyOwner modifier it has just low severity.

Vulnerability Details

In the AlchemistV3 contract the globalMinimumCollateralization should always be >= minimumCollateralization as checked by the function AlchemistV3::setGlobalMinimumCollateralization.

    function setGlobalMinimumCollateralization(uint256 value) external onlyAdmin {
@>      _checkArgument(value >= minimumCollateralization);
        globalMinimumCollateralization = value;
        emit GlobalMinimumCollateralizationUpdated(value);
    }

However, the minimumCollateralization could be set to a value >= globalMinimumCollateralization breaking this way the property above, through the AlchemistV3::setMinimumCollateralization.

Indeed the only check made in the AlchemistV3::setMinimumCollateralization regards the value to be >= FIXED_POINT_SCALAR. However, the Admin could call this function more than once. In this case the value should be checked to be always <= globalMinimumCollateralization.

Impact Details

The AlchemistV3 contract allows the parameter minimumCollateralization to be set by the Admin in a way that should not be allowed minimumCollateralization > globalMinimumCollateralization through the setMinimumCollateralization function. This has an impact on all functions using the collateralization values that do not comply with the already mentioned property. The severity could have been high in case this function could not be called only by the Admin. Therefore, considering that the function has the onlyAdmin modifier, its severity is low.

References

https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/AlchemistV3.sol#L292-L297

https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/AlchemistV3.sol#L300-L304

Mitigation

A possible mitigation action could be the one below:

https://gist.github.com/0x4th05/a3922b7a322e5656f4a8a38fe3937f01

Proof of Concept

Proof of Concept

Add the following test to the test suite (AlchemistV3.t.sol) of the project, and run this: forge test --mt test_setminimumCollateralizationGreaterThanGlobalMinimumCollateralization -vvvvv and it should pass

The result is the following:

Was this helpful?