Integer Overflow in Vesting Period Calculation Enables Premature Full Unlock
| Severity | INFORMATIONAL |
| CVSS | 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| Vulnerability Type | Integer Overflow |
| Asset | LocpQgucEQHbqNABEYvBvwoxCPsSbG91A1QaQhQQqjn - Jupiter Lock |
| Endpoint | https://github.com/jup-ag/jup-lock%20(programs/locker/src/state/vesting_escrow.rs,%20lines%20140-150) |
Description
Steps to Reproduce
Impact
Activity
Hi @coleflumpus, Thank you for your submission. After reviewing the report against our current codebase, we've determined this is not applicable. The vulnerability described - that the period count is not capped before multiplication - does not exist in the code. The get_max_unlocked_amount() function explicitly caps the computed period count before performing the multiplication: ``` let period = current_ts .safe_sub(self.cliff_time)? .safe_div(self.frequency)?; let period = period.min(self.number_of_period); // capped here ``` Also, all arithmetic in this function uses checked math (safe_mul, safe_add, etc.) which returns an error on overflow rather than wrapping. The wrapping/silent overflow scenario described in the report cannot occur. The recommended fix in the report — "cap the calculated period count to number_of_period before multiplication" - is already implemented. We are closing this report as Not Applicable. Thanks for thinking of our security - we appreciate the effort.
