fix(auth): ignore spoofable proxy IP headers#613
Open
JSONbored wants to merge 1 commit into
Open
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 96e8936 | Commit Preview URL Branch Preview URL |
Jun 12 2026, 07:30 AM |
|
Important Gittensory found maintainer review notesPublic GitHub metadata was checked for review readiness. Gittensor-specific context appears only when confirmed. Readiness score: 91/100
Signal definitions
Review context
Maintainer notes
Contributor next steps
Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. Learn more about Gittensor contribution workflows. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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