fix(api): reject overflowing pagination limits - #173
Draft
vincentkoc wants to merge 1 commit into
Draft
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
vincentkoc
force-pushed
the
fix/clickclack-pagination-bounds
branch
from
August 21, 2026 13:16
6932143 to
37ce1eb
Compare
Member
Author
|
@clawsweeper re-review |
Contributor
|
🦞👀 Re-review progress:
|
Member
Author
|
@clawsweeper re-review |
Contributor
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where oversized pagination values could cross an architecture-dependent
intboundary before reaching PostgreSQL'sint32query parameters. It also removes request-controlled slice capacities reported by CodeQL alerts 3-7.Why This Change Was Made
The HTTP boundary now parses pagination integers at the database contract's 32-bit width, so overflow is rejected before values enter store interfaces. Result slices allocate from the authoritative row count returned by the bounded query rather than the original request limit.
User Impact
Malformed or overflowing pagination inputs fail predictably instead of wrapping at database boundaries or influencing allocation size. Valid pagination behavior is unchanged.
Evidence
go test ./apps/api/internal/store/... ./apps/api/internal/httpapi2147483648across generic, search, and workspace-member pagination parsing.go/incorrect-integer-conversionalerts 6-7 at their shared parser andgo/uncontrolled-allocation-sizealerts 3-5 at the allocation owners.