Skip to content
DoS Audit finding Intermediate

Liquidation will return because of insufficient funds

A liquidation transaction fails because the protocol first transfers the entire collateral to the Transmuter to cover an earmark, leaving no funds to pay the liquidator's reward. This causes a denial of service, preventing liquidations of positions that have an earmark.

pashap9990 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

56846 sc medium liquidation will return because of insufficient funds

Submitted on Oct 21st 2025 at 07:22:43 UTC by @pashap9990 for Audit Comp | Alchemix V3

Description

Finding Description and Impact

CPD holders' positions are prone to liquidation upon their CR falling below collateralizationLowerBound. Also, the earmark will be paid first, and then the liquidator will get a reward fee once the debt is gone. Nevertheless, the liquidation transaction will fail due to insufficient funds, resulting in a denial of service.

Textual PoC

Presume collateralizationLowerBound is 1.05

  • User A deposits 110 MYT and mints 100 alUSD. [collateral's worth = 110, debt = 100, earmark = 0] A redemption will be initiated by Transmuter with a redeem amount of 100 alUSD, reflecting user A's status after 5,256,000 blocks. [collateral's worth = 110, debt = 100, earmark = 100]
  • The price of MYT has decreased by 20%, indicating the status of user A. [collateral's worth = 91, debt = 100, earmark = 100]
  • A liquidator identifies the opportunity and initiates a liquidation transaction. _forceReapy will be invoked as user A possesses an earmark, resulting in the transfer of 110 MYT to Transmuter. The liquidate function subsequently attempts to transfer 1.1 MYT to the liquidator as a reward. However, the transaction will fail due to insufficient funds.

Code Snippet

https://github.com/alchemix-finance/v3-poc/blob/a192ab313c81ba3ab621d9ca1ee000110fbdd1e9/src/AlchemistV3.sol#L826C24-L826C66

Proof of Concept

Proof of Concept

Kindly incorporate the following PoC in Alchemist.t.sol

Solidity
    function testLiquidationWillRevertDueToLackOfFunds() public {
        vm.prank(alOwner);
        alchemist.setProtocolFee(protocolFee);
        
        
        vm.startPrank(someWhale);
        IMockYieldToken(mockStrategyYieldToken).mint(whaleSupply, someWhale);
        vm.stopPrank();

        
        vm.startPrank(address(0xbeef));
        SafeERC20.safeApprove(address(vault), address(alchemist), depositAmount + 100e18);
        alchemist.deposit(110e18, address(0xbeef), 0);
        // a single position nft would have been minted to 0xbeef
        uint256 tokenIdFor0xBeef = AlchemistNFTHelper.getFirstTokenId(address(0xbeef), address(alchemistNFT));
        alchemist.mint(tokenIdFor0xBeef, 99e18 , address(0xbeef));
        vm.stopPrank();


        vm.startPrank(address(0xdad));
        deal(address(alToken), address(0xdad), 99e18);
        SafeERC20.safeApprove(address(alToken), address(transmuterLogic), 99e18);
        transmuterLogic.createRedemption(99e18);
        vm.stopPrank();

        uint256 transmuterPreviousBalance = IERC20(address(vault)).balanceOf(address(transmuterLogic));
        vm.roll(block.number + 5_256_000);
        (uint collateral, uint debt, uint earmark) = alchemist.getCDP(tokenIdFor0xBeef);

        // // modify yield token price via modifying underlying token supply
        uint256 initialVaultSupply = IERC20(address(mockStrategyYieldToken)).totalSupply();
        IMockYieldToken(mockStrategyYieldToken).updateMockTokenSupply(initialVaultSupply);
        // increasing yeild token suppy by 20 bps or 20%  while keeping the unederlying supply unchanged
        uint256 modifiedVaultSupply = (initialVaultSupply * 2000 / 10_000) + initialVaultSupply;
        IMockYieldToken(mockStrategyYieldToken).updateMockTokenSupply(modifiedVaultSupply);

        uint totalValue = alchemist.totalValue(tokenIdFor0xBeef);
        vm.expectRevert();
        (uint256 assets, uint256 feeInYield, uint256 feeInUnderlying) = alchemist.liquidate(tokenIdFor0xBeef);


    }

The original report as published on Immunefi, by pashap9990. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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 liquidation logic repays the earmark by transferring the full collateral before attempting to pay the liquidator's fee, without checking that enough collateral remains.

What the attacker needed

Position has an earmark; collateral price drops below lower bound; liquidator attempts liquidation

How it was found

  1. User A deposits collateral and mints alUSD, creating a position with no earmark.
  2. A redemption is initiated, creating an earmark equal to the debt.
  3. The collateral price drops so the position becomes undercollateralised.
  4. A liquidator calls liquidate, which first transfers all collateral to the Transmuter to cover the earmark.
  5. The liquidate function then tries to pay the liquidator's reward but reverts due to insufficient funds.

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.

When a borrower's collateral value falls too low, anyone can liquidate the position to keep the system solvent and earn a reward. Here, the code first sends all the collateral to a savings contract (the Transmuter) to cover a pending redemption, so there is nothing left to pay the liquidator. As a result, the liquidation always fails and the bad debt cannot be cleared.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by pashap9990

View all

12 more disclosed reports, best first.

More from Alchemix V3

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.