58138 sc critical liquidator fees could surpass the user remaining collateral resulting in protocol insolvency

Submitted on Oct 30th 2025 at 22:00:22 UTC by @a16 for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #58138

  • Report Type: Smart Contract

  • Report severity: Critical

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

  • Impacts:

    • Permanent freezing of funds

    • Protocol insolvency

    • Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield

Description

Brief/Intro

When calling liquidate(), fees paid to the liquidator could surpass the user's remaining collateral, causing the protocol to pay the excess myt "out of pocket", which could cause protocol insolvency.

Vulnerability Details

The underlying issue is these two lines:

In the first line, the protocol calls _resolveRepaymentFee() which returns feeInYield that is proportional to repaidAmountInYield and is not capped by account.collateralBalance.

This means that if the remaining user collateral was not enough to back the liquidator fee payment, the difference would be paid from the amount that was supposed to back other users' positions.

Impact Details

If the sum of internal accounting of users' collaterals exceed the actual myt backing, then the AlchemistV3 contract would not be able to fully repay all users, causing protocol insolvency and a loss of user funds.

Proof of Concept

The following function could be added to AlchemistV3.t.sol

function test_Repay_Only_Overpays_If_Fee_Exceeds_Remaining_Collateral() external { // Configure: isolate repay-only, 10% repayment fee address trueAdmin = alchemist.admin(); vm.startPrank(trueAdmin); alchemist.setDepositCap(type(uint256).max); alchemist.setProtocolFee(0); alchemist.setLiquidatorFee(0); alchemist.setRepaymentFee(10_00); // 10% vm.stopPrank();

}

Was this helpful?