57369 sc high deallocation may revert due to an underflow

Submitted on Oct 25th 2025 at 15:16:47 UTC by @PotEater for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #57369

  • Report Type: Smart Contract

  • Report severity: High

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

  • Impacts:

    • Temporary freezing of funds for at least 24 hour

Description

Brief/Intro

The function deallocate may revert due to an underflow when the amountDeallocated is greater than oldAllocation.

Vulnerability Details

The function deallocate is used to remove funds from strategies by calling internal deallocate function with the specified asset amount. The function then attemps to calculate the new allocation by subtracting the amount deallocated from oldAllocation.

The vulnerability arises because amountDeallocated, which is returned by _deallocate, can potentially be greater than oldAllocation. This may happen when _deallocate withdraws more funds than expected. And when amountDeallocated exceeds oldAllocation, the tx would revert due to underflow.

Code snippet:

Impact Details

The impact is temporary freezing of funds, because the admin would not be able to deallocate funds from strategies. This is a potential Denial of Service.

References

https://github.com/alchemix-finance/v3-poc/blob/a192ab313c81ba3ab621d9ca1ee000110fbdd1e9/src/MYTStrategy.sol#L130

Proof of Concept

Proof of Concept

Create a new file in path src/test/PoC.t.sol:

Run with: forge test --match-test test_underflow -vvvv

PoC:

Result:

Was this helpful?