56491 sc critical user collateral loss triggered by setminimumcollateralization update

Submitted on Oct 16th 2025 at 19:07:29 UTC by @magtentic for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #56491

  • Report Type: Smart Contract

  • Report severity: Critical

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

  • Impacts:

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

Description

Brief/Intro

In AlchemistV3, an admin can update minimumCollateralization via setMinimumCollateralization as part of their normal operations. If a user deposits and borrows before this update and leaves their position open, normal protocol operations (withdrawals, redemptions) after the update can cause unexpected reduction of their collateral, resulting in a permanent loss. This occurs because _collateralWeight is updated globally, but the user’s account does not automatically sync with the new weight, leading to over-removal of collateral during withdrawal/redemption calculations.

From tests, the calculations mostly behaves as most functions use minimumCollateralization as a percentage :

minimumCollateralization / FIXED_POINT_SCALAR FIXED_POINT_SCALAR / minimumCollateralization

Vulnerability Details

As a user does deposits before a minimumCollateralization and then initiates a borrow without withdrawing their funds before any further interactions happen from other users results in their funds been safe and they are able to withdraw the correct collateral. When they leave the debt and let normal operations occur on the contract, this can lead to a scenario where the user then loses their collateral which they wouldn't have lost had they withdrawn before other interactions. The reason for this is that normal interactions affect _collateralWeight which is not stored on the user's account level as the account had no syncing occuring since prior to the update happening.

Impact Details

  • Permanent loss of user funds.

  • No action is required from an attacker as this happens in normal protocol usage.

  • Could affect multiple users over time.

  • Admin action triggers it indirectly, so it’s a critical design flaw.

References

Alchemist V3arrow-up-right

Proof of Concept

Proof of Concept

For this test, I did add the below lines of code to display the specific values which result in the loss.

Code run to show the loss of funds from the user's collateral.

Was this helpful?