PerpetualVault::getUserDeposits()
Observation:
The function PerpetualVault::getUserDeposits() iterating over a user’s deposit IDs uses a loop variable of type uint8:
Risk:
If a user accumulates more than 255 deposits, the loop variable will overflow (or simply stop early), resulting in an incomplete or corrupted list of deposit IDs. Although this is a view function and does not directly affect fund security, it may lead to incorrect data being displayed or used by off-chain systems—potentially opening up avenues for user interface manipulation or misreporting of a user’s positions.
Recommendation:
Use a larger integer type (e.g. uint256) for the loop counter to correctly handle any realistic number of deposits.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.