Skip to content

Cap huge public follow-list offsets before Supabase range queries #356

@Zekbot001

Description

@Zekbot001

Bug

The public follower-list endpoints accept unbounded numeric offset values:

  • GET /api/users/[username]/followers
  • GET /api/users/[username]/following

A request such as ?offset=999999999&limit=10 passes an extreme range start into Supabase .range(...) and returns the same oversized offset in pagination metadata.

Expected

Keep normal offsets unchanged, but cap extremely large offsets before building Supabase ranges and returning pagination metadata. This matches the pagination hardening already used in other public endpoints.

Proposed fix

Cap offsets at 100_000 in both mirrored routes and add regression coverage for the generated range bounds and response metadata.

Paid task context: https://ugig.net/gigs/abd6b2a0-e728-48cf-a46f-f99e419ed94e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions