Rate limiter is keyed on ip:port, so limits apply per connection instead of per client IP
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in src/backend/server/server.go and find the GetLimiter call sites used by the rate-limited handlers. Add a regression test that exhausts the burst from 1.2.3.4:1000 and expects a 429 from 1.2.3.4:2000; then verify the limit is keyed by client IP across connections and the test passes.
Written by the indexing model from the issue text.
Description
Problem
Every rate-limited handler in src/backend/server/server.go (logsHandler, mappingsHandler, statsHandler, handlePIICheck, …) does:
ip := r.RemoteAddr
limiter := s.rateLimiter.GetLimiter(ip)
r.RemoteAddr is host:port, and the port is the client's ephemeral source port. Each new TCP connection from the same client gets a new port, so it gets a fresh limiter with a full burst. In practice, the NewRateLimiter(10, 20) limit only applies within a single keep-alive connection. A client that opens new connections gets past it.
Spotted while reviewing #611. Its tests reuse a fixed RemoteAddr such as "8.8.8.8:1234", which hides the problem.
Suggested fix
- Add a small helper, e.g.
clientIP(r *http.Request) string, that usesnet.SplitHostPort(r.RemoteAddr)and falls back toRemoteAddrif that returns an error. Use it at everyGetLimitercall site. - Don't trust
X-Forwarded-Forby default. The server listens locally, and the header is easy for a client to spoof. - Add a regression test: use up the burst from
1.2.3.4:1000, then expect a429from1.2.3.4:2000.
- Dominant language
- Go
- Stars
- 438
- Forks
- 51
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dataiku/kiji-proxy
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dataiku/kiji-proxy#629 ·
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
dataiku/kiji-proxy#626 ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
dataiku/kiji-proxy#596 · 1 comment ·
Maintainers usually reply within 4 days
-
internationalization
Difficulty 2/5 1-2 days Newbie friendliness 68/100
dataiku/kiji-proxy#575 ·
Maintainers usually reply within 4 days
-
Add Go package-level doc comments to src/backend/providers/May be free again @min-ok claimed this 18 days ago, and no pull request is open. Opengood first issue
Difficulty 2/5 Under an hour Newbie friendliness 84/100
dataiku/kiji-proxy#427 · 1 comment ·
Maintainers usually reply within 4 days
All issues in dataiku/kiji-proxy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenTollGate/tollgate-module-basic-go#1027 ·
Maintainers usually reply within 1 day
-
help wanted needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
hivecommons/hive#13223 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG]: Windows GUI package of v1.17.0-rc3 has no GTK DLLsPossibly taken @andrut-ds claimed this today. Openbug CI/CD Pactus-GUI Windows
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pactus-project/pactus#2428 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day