V3-16RecommendationOpenGovernance & configuration
Member and vote lookups depend on lists staying sorted
Membership and votes are checked by binary search, which only works on a sorted list.
Why this is a risk, not a vulnerability · Documented behavior
Every code path in the immutable program keeps these lists sorted. Reports must show a lookup actually returning the wrong answer. What is a vulnerability
- Program
- Squads V3
- Source
- Certora SQRC-05 (Squads V4); public program behavior
- Code
- View at c95b767
is_member and the approve, reject, and cancel vote checks use binary search. create sorts and de-duplicates the member list, and every path that adds a member or a vote sorts the list again, so the checks hold today. Because the program is immutable, no future path can break this, but integrators reading these accounts should not assume more than the program guarantees. Squads V4 has the related property V4-17.
What to do
- Integrators: validate member lists for duplicates client-side, and use the same sorted order when reasoning about membership.