In the UpliftOnlyExample
contract, there is a vulnerability in the position limit check that allows users to exceed the intended maximum of 100 positions per account. The current implementation uses a >
operator instead of >=
, enabling users to create 101 positions when the limit should be 100, directly contradicting the intended business logic.
The vulnerability exists in the position limit validation logic within the UpliftOnlyExample
contract. Here's how the issue manifests:
The contract maintains a mapping poolsFeeData
that tracks positions for each pool and user
There is an intended limit of 100 positions per user per pool
The current check is implemented as:
The issue arises because:
The check uses >
instead of >=
When a user has exactly 100 positions, the check passes (100 > 100
is false)
The new position is then added, resulting in 101 positions
This bypasses the intended 100-position limit
The validation occurs before the position is added, creating a off-by-one error that allows one extra position beyond the intended limit. Which can lead to a DoS scenario where users cannot access there positions due to the gas cost exceeding what was anticipated for the 100 positions. In addition this allows users to directly bypass the intended limitations set by the protocol.
DoS of user positions due to gas cost exceeding what was anticipated for the 100 positions. As well as allowing users to directly bypass the intended limitations set by the protocol.
Manual Review
Modify the position limit check to use >=
instead of >
:
This ensures that users cannot exceed the intended limit.
Only 1 more NFT won’t have any impact. Informational.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.