[Bug]: Clip rate limiter counts each IPv6 address separately

Open Beginner friendly
#122 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start at the rate-limit keying in src/api/clips.rs around line 1953, then read auth::throttle::key to see how the password throttle masks IPv6 to a /64. Make that helper pub(crate) and use it for the clip buckets so one client cannot spread requests across addresses in its prefix. Look at the existing throttle tests for the pattern to copy. Done means two IPv6 addresses inside the same /64 land in one bucket.

Written by the indexing model from the issue text.

Description

bug

[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.

Version

0.40.0 (feat/desktop, 017a837b)

Area

Clips

What happened?

The public clip rate limiter keys on the full client address (src/api/clips.rs:1953). The password throttle groups IPv6 by /64 (auth::throttle::key) because people usually have the whole /64, so here one client can spread requests over many addresses.

Expected behavior

IPv6 clients are limited per /64, like the password throttle.

Suggested fix

Reuse throttle::key (make it pub(crate)) for the clip buckets.

Dominant language
TypeScript
Stars
4
Forks
1
Avg merge
4h 49m
Merged PRs (30d)
5

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tinystream-dev/tinystream

All issues in tinystream-dev/tinystream

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.