Setminimumcollateralization function also needs a another check
The admin setter for the minimum collateralization ratio does not check the new value against the existing collateralization lower bound. If the admin lowers the minimum below that bound, the liquidation logic can liquidate accounts that are still healthy under the new minimum.
- Disclosed after under an hour
56927 sc medium setminimumcollateralization function also needs a another check
Submitted on Oct 21st 2025 at 20:11:59 UTC by @griffin for Audit Comp | Alchemix V3
- Report ID: #56927
- Report Type: Smart Contract
- Report severity: Medium
- Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi\\_audit/src/AlchemistV3.sol
- Impacts:
Description
Vulnerability Details
function setMinimumCollateralization(uint256 value) external onlyAdmin {
_checkArgument(value >= FIXED_POINT_SCALAR);
minimumCollateralization = value;
emit MinimumCollateralizationUpdated(value);
}
there is no check to ensure that the new value is greater than or equal to the current collateralizationlowerbound. this can result in a state where collateralizationlowerbound > minimumcollateralization, violating the intended invariant that the lower bound for liquidation should always be less than or equal to the minimum required collateralization for healthy accounts.
Impact Details
if the admin sets minimumcollateralization to a value below collateralizationlowerbound, the liquidation logic in _liquidate can trigger on accounts that are above the new minimumcollateralization but below the old collateralizationlowerbound. this leads to unintended liquidations, where healthy accounts (per the updated minimum) are liquidated
References
Proof of Concept
Proof of Concept
one , admin call setMinimumCollateralization with 50* 1e18(because FIXED_POINT_SCALAR is 1e18)
second, admin call setMinimumCollateralization with 40 * 1e18
but admin shouldnt be able to do the second step
test code :
pragma solidity 0.8.28;
import "src/test/AlchemistV3_6_decimals.t.sol";
contract testM is AlchemistV3Test {
function setUp() public override {
super.setUpMYT(6);
}
function test_M() public {
vm.startPrank(admin);
alchemist.setMinimumCollateralization(50e18);
alchemist.setMinimumCollateralization(40e18);
assertTrue(alchemist.collateralizationLowerBound() > alchemist.minimumCollateralization(), "inconsistency not created");
}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the setMinimumCollateralization setter only checks the value against the fixed-point scalar and not against collateralizationLowerBound, so the ordering invariant between the two thresholds is not enforced.
Impact
Accounts that are above the new minimum but below the old lower bound could be liquidated unintentionally, though this requires the admin to make the misconfiguration.
What the attacker needed
Admin privileges; admin sets a value below the lower bound
How it was found
- As admin, set the minimum collateralization to 50e18.
- As admin, set the minimum collateralization to 40e18, which the contract accepts.
- Observe that the collateralization lower bound is now greater than the minimum collateralization.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A lending protocol tracks two thresholds: the minimum collateral a healthy account must keep, and a lower bound used when deciding to liquidate. This report says the admin function that changes the minimum never checks it against the lower bound, so the two can end up in the wrong order and accounts that should be safe can be liquidated.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.