Repository navigation
fix(process-control): avoid sending management token to DNS-recorded stop hosts - #5086
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
ChangesGraceful shutdown routing
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: 🔵 Low · up to IPv6-only deployments may lose graceful draining during shutdown, though the impact is limited to those configurations. 🚥 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. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
Motivation
A graceful-stop request POSTs
/api/stopwith thex-opencodex-api-keymanagement token to the recordedruntime.hostname. When that recorded value is a DNS name rather than an IP literal, resolution can change between bind and stop — DNS rebinding or an attacker-controlled answer would receive the admin token. This is the same credential-destination class as the DNS-rebinding fence already landed for credential hostnames, on a different path.Description
gracefulStopHostnow follows the recorded bind hostname only when it is an IP literal (node:netisIP): IPv4 returns bare, IPv6 returns bracketed. DNS names, loopback aliases, and wildcard binds all fall back to127.0.0.1, so the token is never sent through a DNS resolution.Tests
bun test tests/lib/process-control-graceful.test.ts— new cases cover DNS names falling back to loopback and the management token never being sent to a recorded DNS hostname.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.
Summary by CodeRabbit