Repository navigation
[PR] fix: validate diagnostic loopback host exemptions - #7397
Merged
ranxianglei merged 1 commit intoNov 20, 2026
Merged
ranxianglei merged 1 commit into
ranxianglei merged 1 commit into
Conversation
⚠️ MODEL-FACING TEXT CHANGE Failure-response host fields now mask 127-prefixed DNS names and keep a portless IPv6 loopback intact. Status, failure kind, code and retry policy are unchanged; the exact visible 502 error is covered by a regression. Require actual IPv4 loopback addresses instead of accepting any 127. prefix. Retain Node's numeric IPv4 aliases after syntax validation and canonicalization. Split bracketed display targets after their closing bracket so an address colon is never mistaken for a port separator. The unchanged base fails six behavior regressions with two controls passing. The fix passes 52 focused tests, typecheck, build and both static gates.
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.
The failure-response
hostfield and visible error now mask 127-prefixed DNS names; a portless IPv6 loopback stays intact. Failure status, kind, code and retry behavior remain unchanged. The regression checks the exact visible textacp-proxy failure: dns ENOTFOUND <private-host>:8443, so clients retain the failure class and port without receiving a private hostname.Fixes #7396
Problem
The loopback display exemption accepts
ip.startsWith("127."), which also matches private DNS names such as127.customer.internal. This leaks those names through diagnostic URLs, actual host-event files, and structured upstream-failure responses despite host masking being enabled.Changes
127.1,127.0.1,127.0x1, and octal spellings) only after a numeric-only candidate canonicalizes to a valid 127/8 address.new URL("http://[::1]").hosthas no port and must not be split at an IPv6 address colon.This changes diagnostic host visibility, not connection admission, name resolution or routing. No config field, environment variable, dependency or kernel change.
Validation
The unchanged tested base has 6 failing behavior regressions and 2 passing controls. The fixed branch passes 52/52 focused tests:
The new regressions exercise the real host-event file writer and the 502 response builder, alongside direct URL/display controls. Existing tests include real proxy logs, connection failures, CONNECT and WebSocket error paths. Full regression remains the remote CI lanes on the pushed PR head.
Tested base:
1e357bf2d6632bfbd2a74ffb70ecee1af1ec7cc3; Node.js 24.22.3, Linux x86_64.Duplicate boundary
All-author/all-state searches and the latest 100 actual open PRs found no equivalent repair. #3653/#4257 introduced the exemption, #6098 fixed credentials in genuine loopback URLs, and #7393 fixes repeated embedded-URL scans. Those behaviors are preserved.