Skip to content

fix(api): reject overflowing pagination limits - #173

Draft
vincentkoc wants to merge 1 commit into
mainfrom
fix/clickclack-pagination-bounds
Draft

fix(api): reject overflowing pagination limits#173
vincentkoc wants to merge 1 commit into
mainfrom
fix/clickclack-pagination-bounds

Conversation

@vincentkoc

Copy link
Copy Markdown
Member
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 int boundary before reaching PostgreSQL's int32 query 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/httpapi
  • Added regression coverage for 2147483648 across generic, search, and workspace-member pagination parsing.
  • Production LOC: +9/-9. Test LOC: +10/-0.
  • Covers go/incorrect-integer-conversion alerts 6-7 at their shared parser and go/uncontrolled-allocation-size alerts 3-5 at the allocation owners.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc
vincentkoc force-pushed the fix/clickclack-pagination-bounds branch from 6932143 to 37ce1eb Compare August 21, 2026 13:16
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant