mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6290] [Bug]: Outbound "Check (TCP)" always fails with "host www.google.com resolves to blocked private/internal address 2001::1" #4268
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4268
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tufu9441 on GitHub (Aug 23, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6290
Describe the bug
This error message always appears when clicking the ”Check (TCP)“ button:
Something went wrong (host www.google.com resolves to blocked private/internal address 2001::1)However, the outbounds can be connected by clients normally.
How to reproduce the problem
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
3x-ui version
3.6.0
Xray-core version
26.7.28
How did you install 3x-ui?
Docker / Docker Compose
Operating system
Synology DSM 7.4.1
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Aug 23, 2026):
Confirmed bug — the panel refuses the test before it ever probes your outbound, and in TCP mode it refuses over a URL it does not even use. Your outbound is fine (as you observed); the failure is in the pre-flight validation of the Outbound Test URL.
I could not open the screenshot, but the error string in your description is enough — nothing further is needed from you.
What actually happens
The "Check (TCP)" button posts to
/panel/api/xray/testOutboundswithmode=tcp(frontend/src/hooks/useXraySetting.ts:303).Before dispatching anything, the controller loads the configured test URL and resolves it on the panel host:
The default value is
https://www.google.com/generate_204(internal/web/service/setting.go:130).rejectPrivateHostrejects the hostname if any single resolved address is blocked:Your container's resolver returns
2001::1as an AAAA answer forwww.google.com. That address falls inside2001::/32, which is blocked outright:jsonMsgformats it asmsg + " (" + errStr + ")"(internal/web/controller/util.go:172), producing exactly the toast you saw.Two things make this a defect rather than the guard doing its job:
In TCP mode the test URL is never used.
mode=tcproutes the outbound into the TCP lane (internal/web/service/outbound/probe_http.go:171), which callstestOutboundTCP(outboundJSON string)(internal/web/service/outbound/outbound.go:152) — a signature with no test URL at all; it just dials the outbound's own endpoints. The request is aborted over a value it would have ignored.One bad answer kills a good hostname.
www.google.comalso returns perfectly routable A records, and the sibling guard in the same codebase handles exactly this case correctly — it skips blocked addresses and only fails when none are usable:rejectPrivateHostis all-or-nothing instead. Even in HTTP mode the local resolution is not the one that matters — the probe deliberately lets xray resolve the hostname through the tunnel (internal/web/service/outbound/probe_http.go:461-462: "The test URL's hostname is resolved by xray … so DNS goes through the outbound too").Version note
The
2001::/32block arrived inb51f0976fix(netsafe): classify IPv6 transition and CGNAT ranges as internal (2026-08-19).git tag --contains b51f0976lists onlydev-latest— it is not in thev3.6.0tag, whereIsBlockedIPchecked only loopback/private/link-local/unspecified and would have let2001::1through. Sinceinternal/config/versiononmainstill reads3.6.0, adev-latestimage reports "3.6.0" in the panel too, which matches what you filed. So this is an unreleased regression, and you are running a dev build.Workaround for now
Set Xray Settings → Basics → "Outbound Test URL" to a URL whose hostname your panel host resolves cleanly, for example:
Any hostname whose AAAA answer lands in
2001::/32,2002::/16,64:ff9b:1::/48,fec0::/10or100.64.0.0/10will fail the same way. You can check which answers your container gets with:2001::1is not a routable Google address; an AAAA answer like that generally indicates a hijacked or filtered resolver on the host or upstream — that part is inference, not something I can confirm from the repository.I also made the title more specific so the failing button and the exact error are visible from the issue list; the original was "[Bug]: Outbound node latency test failed."
Verdict: Confirmed bug
Severity: High
Confidence: High
Root cause:
internal/web/controller/xray_setting.go:350-355(testOutbounds, same at:317-322intestOutbound) resolves and validates the outbound test URL before dispatch and returns early on failure, including formode=tcp, wheretestOutboundTCP(internal/web/service/outbound/outbound.go:152) never uses it. The validation itself is all-or-nothing:rejectPrivateHost(internal/web/service/url_safety.go:78-82) rejects the hostname on the first blocked address instead of requiring at least one usable one. Triggered whenever the panel host's resolver returns any address inside anetsafeblocked prefix for the test URL's hostname. The enabling change isb51f0976(2026-08-19), which added2001::/32atinternal/util/netsafe/netsafe.go:24.Already fixed: Still present on the default branch (
main, read at02002dc1). Not in any release tag —git tag --contains b51f0976returnsdev-latestonly.Duplicate of: None. Searched
gh search issues --repo MHSanaei/3x-ui "blocked private/internal address" / "outbound test" / "2001::"— #5152 and #5355 are different outbound-test failures with unrelated causes.Evidence:
internal/web/controller/xray_setting.go:351testURL, err := service.SanitizePublicHTTPURL(testURL, false);internal/web/service/url_safety.go:80return fmt.Errorf("host %s resolves to blocked private/internal address %s", hostname, ipAddr.IP.String());internal/util/netsafe/netsafe.go:24netip.MustParsePrefix("2001::/32"), // Teredo (RFC 4380); contrastinternal/util/netsafe/netsafe.go:85-88(continuepast blocked addresses) and:97-102(fail only when nothing was usable);internal/web/service/outbound/probe_http.go:171if mode == "tcp" && !outboundTransportIsUDP(ob) {;internal/web/service/outbound/outbound.go:152func (s *OutboundService) testOutboundTCP(outboundJSON string) (*TestOutboundResult, error);internal/web/controller/util.go:172m.Msg = msg + " (" + errStr + ")";internal/web/service/setting.go:130defaulthttps://www.google.com/generate_204. No test pins the all-or-nothing behaviour:TestSanitizePublicHTTPURLRejectsPrivateAndBadSchemes(internal/web/service/outbound_subscription_test.go:235) andTestSanitizePublicHTTPURLBlocksPrivateAddressUnlessAllowed(internal/web/service/setting_security_test.go:145) only use literal IPs, andTestIsBlockedIP(internal/util/netsafe/netsafe_test.go:10) only coversIsBlockedIPitself.Not determined: Why the reporter's resolver answers
2001::1forwww.google.com— I cannot run DNS from here. Thenslookupoutput above from inside the container would settle it, but it does not change the code defect either way.Suggested fix: Skip the test-URL sanitization for
mode=tcp(or move it into the HTTP lane intestOutboundsParsed, where the URL is actually consumed), and makerejectPrivateHostaccept a hostname that has at least one non-blocked resolved address, matchingSSRFGuardedDialContext's existing skip-and-continue semantics.@MHSanaei — unreleased regression from
b51f0976; it currently breaks the outbound Check button entirely on any host whose resolver returns a bogon AAAA for the default test URL.This reply was generated automatically; a maintainer may follow up.