fix(auth): ignore spoofable proxy IP headers - #613
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | f9f95e5 | Commit Preview URL Branch Preview URL |
Jun 13 2026, 05:37 AM |
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 2 changed file(s) — two independent AI reviewers. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
4390a20 to
b1b2ae5
Compare
Motivation
x-real-ip/x-forwarded-foras fallbacks whencf-connecting-ipwas missing, which let unauthenticated clients spoof rate-limit identities by supplying attacker-controlled XFF entries.Description
clientIp()insrc/auth/rate-limit.tsso the function now only trustscf-connecting-ipand otherwise returns"unknown-ip".X-Forwarded-Forchains and trusted-proxy configuration so header-controlled values are no longer used for rate-limit identities.test/unit/auth.test.tsto assert that proxy headers and configured trusted-proxy values do not produce distinct pre-auth rate-limit keys whencf-connecting-ipis absent.Testing
tsc --noEmitvianpm run typecheck, which completed successfully.vitestvianpm test -- --run test/unit/auth.test.ts --reporter=verbose, and all tests in that file passed (18 tests passed).npm testrun was attempted in this environment but did not complete within the session (environmental/time constraints), so only the targeted unit tests and typecheck were verified.Codex Task