User can't `unlock` when `getTotalUnits == 0` even though tax is zero
A user cannot unlock their tokens when one of the distribution pools has zero total units, even if the corresponding tax allocation is zero. This blocks users from unlocking under certain tax configurations.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-06-superfluid-locker-system-judging/issues/50
Found by
newspacexyz
Summary
User can't unlock when STAKER_DISTRIBUTION_POOL.getTotalUnits() == 0 or LP_DISTRIBUTION_POOL.getTotalUnits() == 0.
But stakerAllocationBP or liquidityProviderAllocationBP can be zero and stakerAllocationBP + liquidityProviderAllocationBP = _BP_DENOMINATOR and this case, user can't unlock.
Root Cause
When stakerAllocationBP + liquidityProviderAllocationBP = _BP_DENOMINATOR but stakerAllocationBP or liquidityProviderAllocationBP is zero, one part of tax is zero so STAKER_DISTRIBUTION_POOL.getTotalUnits() or LP_DISTRIBUTION_POOL.getTotalUnits() can be zero.
Users doesn't stake or provideLiquidity because tax is zero so totalUnits can be zero.
But user can't unlock because it checks only totalUnits, not tax ratio.
Internal Pre-conditions
stakerAllocationBP + liquidityProviderAllocationBP = _BP_DENOMINATORstakerAllocationBP = 0 && liquidityProviderAllocationBP = _BP_DENOMINATORorstakerAllocationBP = _BP_DENOMINATOR && liquidityProviderAllocationBP = 0stakerAllocationBP = 0 && STAKER_DISTRIBUTION_POOL.getTotalUnits() == 0(Becausestakerreward is zero)liquidityProviderAllocationBP = 0 && LP_DISTRIBUTION_POOL.getTotalUnits() == 0(BecauseliquidityProviderreward is zero)
External Pre-conditions
.
Attack Path
.
Impact
User can't unlock.
PoC
No response
Mitigation
Check tax ratio.
+ (uint256 stakerAllocation, uint256 providerAllocation) = STAKING_REWARD_CONTROLLER.getTaxAllocation();
- if (STAKER_DISTRIBUTION_POOL.getTotalUnits() == 0) {
+ if (STAKER_DISTRIBUTION_POOL.getTotalUnits() == 0 && stakerAllocation > 0) {
revert STAKER_DISTRIBUTION_POOL_HAS_NO_UNITS();
}
- if (LP_DISTRIBUTION_POOL.getTotalUnits() == 0) {
+ if (LP_DISTRIBUTION_POOL.getTotalUnits() == 0 && providerAllocation > 0) {
revert LP_DISTRIBUTION_POOL_HAS_NO_UNITS();
}
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/superfluid-finance/fluid/pull/28
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
The unlock function checks only whether the distribution pools have units, without considering whether the corresponding tax allocation is zero.
Impact
Users are unable to unlock their tokens when a distribution pool has zero units and its tax allocation is zero.
What the attacker needed
StakerAllocationBP + liquidityProviderAllocationBP =…; one allocation is zero and the other is _BP_DENOMINATOR; the pool with zero allocation has zero total units
The fix
The unlock function should also check that the tax allocation for the pool is greater than zero before reverting.
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.
In this system, users can lock tokens and later unlock them. The unlock function checks that two reward pools have participants, but if a pool's tax share is zero, it may have no participants, causing the unlock to fail even though it should succeed.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.