fix(server): restrict plaintext sideband overrides to numeric loopback - #1260
fix(server): restrict plaintext sideband overrides to numeric loopback#1260luvs01 wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughChangesLoopback validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
ed1d729 to
d8c72ee
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/server-live.test.ts`:
- Around line 641-642: Add the out-of-range IPv4 URL http://127.256.0.1/v1 to
the existing negative fallback test table alongside the deceptive hostname
cases, and assert that it resolves to the canonical upstream URL using the same
verification path.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 97954408-b8e4-4d0b-9b6c-7f1d5ff972a0
📒 Files selected for processing (2)
src/server/live.tstests/server-live.test.ts
Reject deceptive and out-of-range 127.* hostnames while preserving valid numeric 127/8, localhost, and IPv6 loopback overrides.
990bb25 to
fe25d72
Compare
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This pull request is being kept as a draft automatically. Once every issue above is resolved, it will be marked ready for review again. |
|
Rebased exact head Focused verification on the rebased state:
The branch is now exactly one commit ahead and zero behind |
|
Approved the pending Cross-platform CI run at this exact head, and it came back green. Worth explaining the silence beforehand: contributor PRs queue their workflow runs as To be precise about what this does and does not do: it only unblocks CI. It does not make this mergeable. The four-box readiness checklist in the description is your attestation, and the gate keeps the PR in draft until you complete it. With CI now green at your head, box 1 is provable. If anything in the run looks wrong to you, say so and I will dig into it rather than leaving you to guess. |
Summary
127.and fall back to the canonical secure Realtime endpoint;Why
The plaintext development exception used
hostname.startsWith("127."). A configured URL such ashttp://127.evil.example/v1therefore passed the loopback check even though it names a remote DNS host. The resulting sideband connection is created with the resolved upstream authorization headers and transparently relays Realtime frames.This override is deliberately configuration-file-only and has no management API or GUI write surface, so the practical precondition is trusted local configuration. The fix nevertheless restores the documented invariant that plaintext
http/wsis accepted only for loopback destinations.Verification
tests/server-live.test.ts27/27 passed.b22e0e6d0): the same file 27/27 passed.bun x tsc --noEmit: passed.bun scripts/privacy-scan.ts: passed.git diff --check: passed.Security boundary
The change narrows a credential-destination check. It does not add a new configuration or network surface. Plaintext remains available for numeric 127/8, localhost, and IPv6 loopback development endpoints; all other plaintext hostnames fail closed to
wss://api.openai.com/v1.Checklist
127.*DNS names are rejected.Ready for review; upstream CI and the repository-required maintainer security review for credential-destination changes remain pending.
Summary by CodeRabbit
localhost,.localhost, and IPv6 loopback addresses.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.