57316 sc low allocation cap enforcement missing deadcode
#57316 [SC-Low] Allocation Cap Enforcement Missing & DeadCode
Submitted on Oct 25th 2025 at 07:26:17 UTC by @Aiden for Audit Comp | Alchemix V3
Report ID: #57316
Report Type: Smart Contract
Report severity: Low
Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/AlchemistAllocator.sol
Impacts:
Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Smart Contract Vulnerability Report
Alchemix V3:
Vulnerability Title
Allocation Cap Enforcement Missing & DeadCode
π Report Type
Smart Contract
Target
https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/AlchemistAllocator.sol
Asset
AlchemistAllocator.sol
π¨ Rating
Severity: Medium
Impact: Medium
Description
These two issues below exist in both functions : allocate() , deallocate():
1: Allocation Cap Enforcement Missing:
Because daoTarget is set to the maximum uint256 value, no real limit is enforced on fund allocation or withdrawal.
Consequences:
In the allocate function, an operator can allocate funds to a strategy more or less than the correct amount(cap).
In the deallocate function, an operator can deallocate funds to a strategy more or less than the correct amount(cap).
This means there is no effective control over the amount allocated or deallocated, creating a security risk
why !
here is important :
2: Dead Code:
daoTarget is set to the maximum possible uint256 value. uint256 daoTarget = type(uint256).max; And the two lines below it appear::adjusted = adjusted > daoTarget ? adjusted : daoTarget; This means always results in adjusted = daoTarget, because daoTarget is the maximum uint256 value.
This line is considered Dead Code.
impact
Over-allocation of assets
Vault / DAO β Risk to funds and violation of Vault/DAO policies
Vulnerability Details
These two functions below:
As can be seen , there is no restriction on the amount of funds that can be allocated or deallocated to the strategies within these functions. This is because daoTarget is set to the maximum uint256 value, effectively removing any enforcement of caps.
Proof of Concept (PoC)
Step by Step here :
Full POC ππ½ download and run in github link :ππ½
https://github.com/AidenNabavi/Alchemix
How to fix it
(Recommended)
1: Allocation Cap Enforcement Missing:
A trusted source means a contract such as StrategyClassificationProxy that is controlled and configurable only by the DAO.
function allocate(address adapter, uint256 amount) external { require(msg.sender == admin || operators[msg.sender], "PD"); bytes32 id = IMYTStrategy(adapter).adapterId();
}
2: Dead Code:
replaceadjusted = adjusted > daoTarget ? adjusted : daoTarget; with adjusted = daoTarget
π References
https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/AlchemistAllocator.sol
Link to Proof of Concept
https://github.com/AidenNabavi/Alchemix
Proof of Concept
Step by Step here :
Full POC ππ½ download and run in github link :ππ½
https://github.com/AidenNabavi/Alchemix
Was this helpful?