58642 sc low cap bypass in alchemistallocator deallocate allows over deallocation beyond computed limits
#58642 [SC-Low] Cap Bypass in `AlchemistAllocator.deallocate()` Allows Over-Deallocation Beyond Computed Limits
Submitted on Nov 3rd 2025 at 19:01:07 UTC by @pxng0lin for Audit Comp | Alchemix V3
Report ID: #58642
Report Type: Smart Contract
Report severity: Low
Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/AlchemistAllocator.sol
Impacts:
Protocol insolvency
Smart contract unable to operate due to lack of token funds
Description
Brief / Intro
AlchemistAllocator.deallocate() computes adjusted cap limits based on absoluteCap, relativeCap, and daoTarget but fails to enforce them before calling vault.deallocate(). The deallocate() function computes an adjusted cap limit but fails to enforce it with require(amount <= adjusted), allowing over-deallocation.
While oldAllocation is correctly passed for vault state updates, the unused adjusted computation implies incomplete safety logic—caps are fetched and calculated but ignored, creating a configuration mismatch where governance-set limits are bypassed. Allowing admin/operators to deallocate amounts exceeding the intended caps, potentially draining strategies beyond risk management parameters.
Details
The function calculates
adjusted = absoluteCap < relativeCap ? absoluteCap : relativeCapand further adjusts for operators withdaoTarget.However, no validation ensures
amount <= adjustedbefore proceeding tovault.deallocate(adapter, oldAllocation, amount).This creates a mismatch between the computed safety logic and actual execution, allowing unrestricted deallocations.
Impact
Direct effect: Strategies can be deallocated beyond their computed caps, leading to over-exposure or fund drains.
Scope: Admin or authorised operators can trigger this; affects any strategy with set caps. While admins have full rights and may bypass intentionally, operators are intended to be limited—making the lack of enforcement a delegation failure.
Funds at risk: Potential loss of allocated funds if deallocations exceed intended limits.
Risk Breakdown
**Severity: Critical, configuration bypass in allocation management leads to protocol insolvency.
Exploit difficulty: Low; requires admin/operator privileges.
Reach: All strategies; repeated over-deallocations impacts the entire allocation system.
Recommendation
Add validation before calling vault.deallocate():
This enforces the computed cap limits.
References
Source file:
src/AlchemistAllocator.solPrior audit scan:
reports/cantina_competition_alchemix_may2025.pdf(checked; no duplicate finding)
Proof of Concept
Proof of Concept
Foundry test:
testDeallocateExceedsCap()Add the following test to the existing test suite:
src/test/AlchemistAllocator.t.solRun the following command in the terminal
forge t --mt testDeallocateExceedsCap -vvvThe test sets absolute cap to 25 ether, allocates 50 ether as operator, then deallocates 50 ether (exceeding the 25 ether adjusted cap), showing the bypass succeeds.
Test Code
Result
Was this helpful?