56727 sc high underlying increase in forced repayments leads to insolvency

Submitted on Oct 19th 2025 at 22:35:18 UTC by @madman for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #56727

  • Report Type: Smart Contract

  • Report severity: High

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

  • Impacts:

    • Smart contract unable to operate due to lack of token funds

    • Protocol insolvency

Description

Brief/Intro

In AlchemistV3::_liquidate, undercollateralized accounts forcibly pay their debts before being liquidated. However, both the protocol fees and the liquidated amount transferred to the Transmuter are not deducted from mySharesDeposited, leading to an increase in perceived total underlying value. This increase causes the bad debt downscaling mechanism to not be triggered, leading to insolvency.

Vulnerability Details

Forced payments during liquidations fail to deduct liquidated amounts from mySharesDeposited, as shown below in Snippet 1.

Snippet 1

In the Transmuter, when claiming redemptions, we have:

Snippet 2

The bad debt ratio is skewed downwards, because it considers both the Transmuter's balance (which increased) as well as the Alchemist's total underlying value (unchanged). That is, the denominator goes up and badDebtRatio goes down.

Snippet 3

A further decrease in MYT value will only offset this underestimation, e.g bringing the badDebtRatio from 0.5 to 0.7. As such, users can freely claim transmuted amounts with no downscaling.

Impact Details

The bad debt handler mechanism fails to act after forced repayments occur because of incorrect internal accounting. Ultimately, it results in protocol insolvency: more MYT tokens will be up for claiming than the amount available.

Proof of Concept

Proof of Concept

We will craft the following scenario:

  1. Users deposit and max mint.

  2. Users create redemptions in the Transmuter.

  3. MYT price drops slightly, triggering force repays only.

  4. The perceived underlying value goes up, decreasing bad debt ratio.

  5. MYT price drops more, increasing the bad debt ratio, but not enough for scaling to take place.

  6. First users claim full amounts, others are left with nothing.

We include the PoC below in Foundry, our test is the very last function: testForceRepay_Protocol_Insolvent().

As output, we get:

Was this helpful?