Skip to content

Add anti-enumeration protection against claim-token guessing on /claim/[token] #402

Description

@phertyameen

Location

  • frontend/app/claim/[token]/
  • frontend/lib/ (the call site that validates a token against bridgelet-sdk)

Problem

The /claim/[token] route accepts an arbitrary token in the URL and
presumably calls bridgelet-sdk to validate it. If there's no rate
limiting or anti-enumeration protection at the frontend layer (in addition
to whatever exists, or doesn't yet exist, at the SDK layer), an attacker
could script requests to this route trying many token values, hoping to
find a currently-valid, unclaimed token before its rightful recipient does.

Impact

Depending on the claim token's entropy and the SDK's default 30-day expiry
window (documented in bridgelet-sdk), a sufficiently determined attacker
performing sustained enumeration has a nonzero and worth-quantifying chance
of guessing a valid, unclaimed token and redeeming funds intended for
someone else. This is a direct funds-theft vector, not just a nuisance.

Fix

  • Confirm the claim token's entropy (length/character set) is large enough
    that brute-force guessing is computationally infeasible even without
    rate limiting, and document that analysis.
  • Regardless, add rate limiting at the edge (Next.js middleware or hosting-
    platform level) for repeated /claim/[*] requests from a single
    IP/fingerprint within a short window, coordinated with whatever rate
    limiting exists (or should be added) in bridgelet-sdk.
  • Ensure failed/invalid claim attempts don't leak information that would
    help an attacker distinguish "token doesn't exist" from "token exists but
    is expired/already claimed" (timing or response-shape side channels).

Acceptance criteria

  • Token entropy analysis documented, confirming brute-force infeasibility or justifying added mitigations
  • Rate limiting in place for repeated claim-token attempts
  • Response timing/shape for invalid vs. expired vs. already-claimed tokens doesn't leak distinguishing information
  • Coordinated with equivalent protection (existing or to-be-added) in bridgelet-sdk

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions