[GH-ISSUE #6290] [Bug]: Outbound "Check (TCP)" always fails with "host www.google.com resolves to blocked private/internal address 2001::1" #4268

Closed
opened 2026-10-31 20:38:25 +07:00 by bsakaguchi · 1 comment
Owner

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

  1. Open the "Outbounds" page
  2. Create a new VLESS outbound via subscription
  3. Click "save"
  4. Click "Check (TCP)"

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

Image

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

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
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 1. Open the "Outbounds" page 2. Create a new VLESS outbound via subscription 3. Click "save" 4. Click "Check (TCP)" ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots <img width="1920" height="848" alt="Image" src="https://github.com/user-attachments/assets/a4716807-cc21-408d-8b7f-5c684605e307" /> ### 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 - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:38:25 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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

  1. The "Check (TCP)" button posts to /panel/api/xray/testOutbounds with mode=tcp (frontend/src/hooks/useXraySetting.ts:303).

  2. Before dispatching anything, the controller loads the configured test URL and resolves it on the panel host:

    // internal/web/controller/xray_setting.go:350
    testURL, _ := a.SettingService.GetXrayOutboundTestUrl()
    testURL, err := service.SanitizePublicHTTPURL(testURL, false)
    if err != nil {
        jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
        return
    }
    

    The default value is https://www.google.com/generate_204 (internal/web/service/setting.go:130).

  3. rejectPrivateHost rejects the hostname if any single resolved address is blocked:

    // internal/web/service/url_safety.go:78-82
    for _, ipAddr := range ips {
        if isBlockedIP(ipAddr.IP) {
            return fmt.Errorf("host %s resolves to blocked private/internal address %s", hostname, ipAddr.IP.String())
        }
    }
    
  4. Your container's resolver returns 2001::1 as an AAAA answer for www.google.com. That address falls inside 2001::/32, which is blocked outright:

    // internal/util/netsafe/netsafe.go:24
    netip.MustParsePrefix("2001::/32"),      // Teredo (RFC 4380)
    
  5. jsonMsg formats it as msg + " (" + 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=tcp routes the outbound into the TCP lane (internal/web/service/outbound/probe_http.go:171), which calls testOutboundTCP(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.com also 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:

    // internal/util/netsafe/netsafe.go:85-88
    if !allowPrivate && IsBlockedIP(ipAddr.IP) {
        blockedErr = fmt.Errorf("%w %s", ErrPrivateAddressBlocked, ipAddr.IP)
        continue
    }
    

    rejectPrivateHost is 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::/32 block arrived in b51f0976 fix(netsafe): classify IPv6 transition and CGNAT ranges as internal (2026-08-19). git tag --contains b51f0976 lists only dev-latest — it is not in the v3.6.0 tag, where IsBlockedIP checked only loopback/private/link-local/unspecified and would have let 2001::1 through. Since internal/config/version on main still reads 3.6.0, a dev-latest image 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:

https://cp.cloudflare.com/generate_204

Any hostname whose AAAA answer lands in 2001::/32, 2002::/16, 64:ff9b:1::/48, fec0::/10 or 100.64.0.0/10 will fail the same way. You can check which answers your container gets with:

docker exec -it <your-3x-ui-container> nslookup www.google.com

2001::1 is 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-322 in testOutbound) resolves and validates the outbound test URL before dispatch and returns early on failure, including for mode=tcp, where testOutboundTCP (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 a netsafe blocked prefix for the test URL's hostname. The enabling change is b51f0976 (2026-08-19), which added 2001::/32 at internal/util/netsafe/netsafe.go:24.
Already fixed: Still present on the default branch (main, read at 02002dc1). Not in any release tag — git tag --contains b51f0976 returns dev-latest only.
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:351 testURL, err := service.SanitizePublicHTTPURL(testURL, false); internal/web/service/url_safety.go:80 return fmt.Errorf("host %s resolves to blocked private/internal address %s", hostname, ipAddr.IP.String()); internal/util/netsafe/netsafe.go:24 netip.MustParsePrefix("2001::/32"), // Teredo (RFC 4380); contrast internal/util/netsafe/netsafe.go:85-88 (continue past blocked addresses) and :97-102 (fail only when nothing was usable); internal/web/service/outbound/probe_http.go:171 if mode == "tcp" && !outboundTransportIsUDP(ob) {; internal/web/service/outbound/outbound.go:152 func (s *OutboundService) testOutboundTCP(outboundJSON string) (*TestOutboundResult, error); internal/web/controller/util.go:172 m.Msg = msg + " (" + errStr + ")"; internal/web/service/setting.go:130 default https://www.google.com/generate_204. No test pins the all-or-nothing behaviour: TestSanitizePublicHTTPURLRejectsPrivateAndBadSchemes (internal/web/service/outbound_subscription_test.go:235) and TestSanitizePublicHTTPURLBlocksPrivateAddressUnlessAllowed (internal/web/service/setting_security_test.go:145) only use literal IPs, and TestIsBlockedIP (internal/util/netsafe/netsafe_test.go:10) only covers IsBlockedIP itself.
Not determined: Why the reporter's resolver answers 2001::1 for www.google.com — I cannot run DNS from here. The nslookup output 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 in testOutboundsParsed, where the URL is actually consumed), and make rejectPrivateHost accept a hostname that has at least one non-blocked resolved address, matching SSRFGuardedDialContext'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.

<!-- gh-comment-id:5385968924 --> @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 1. The "Check (TCP)" button posts to `/panel/api/xray/testOutbounds` with `mode=tcp` (`frontend/src/hooks/useXraySetting.ts:303`). 2. Before dispatching anything, the controller loads the configured test URL and resolves it **on the panel host**: ```go // internal/web/controller/xray_setting.go:350 testURL, _ := a.SettingService.GetXrayOutboundTestUrl() testURL, err := service.SanitizePublicHTTPURL(testURL, false) if err != nil { jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err) return } ``` The default value is `https://www.google.com/generate_204` (`internal/web/service/setting.go:130`). 3. `rejectPrivateHost` rejects the hostname if **any single** resolved address is blocked: ```go // internal/web/service/url_safety.go:78-82 for _, ipAddr := range ips { if isBlockedIP(ipAddr.IP) { return fmt.Errorf("host %s resolves to blocked private/internal address %s", hostname, ipAddr.IP.String()) } } ``` 4. Your container's resolver returns `2001::1` as an AAAA answer for `www.google.com`. That address falls inside `2001::/32`, which is blocked outright: ```go // internal/util/netsafe/netsafe.go:24 netip.MustParsePrefix("2001::/32"), // Teredo (RFC 4380) ``` 5. `jsonMsg` formats it as `msg + " (" + 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=tcp` routes the outbound into the TCP lane (`internal/web/service/outbound/probe_http.go:171`), which calls `testOutboundTCP(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.com` also 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: ```go // internal/util/netsafe/netsafe.go:85-88 if !allowPrivate && IsBlockedIP(ipAddr.IP) { blockedErr = fmt.Errorf("%w %s", ErrPrivateAddressBlocked, ipAddr.IP) continue } ``` `rejectPrivateHost` is 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::/32` block arrived in `b51f0976` *fix(netsafe): classify IPv6 transition and CGNAT ranges as internal* (2026-08-19). `git tag --contains b51f0976` lists only `dev-latest` — it is **not** in the `v3.6.0` tag, where `IsBlockedIP` checked only loopback/private/link-local/unspecified and would have let `2001::1` through. Since `internal/config/version` on `main` still reads `3.6.0`, a `dev-latest` image 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: ``` https://cp.cloudflare.com/generate_204 ``` Any hostname whose AAAA answer lands in `2001::/32`, `2002::/16`, `64:ff9b:1::/48`, `fec0::/10` or `100.64.0.0/10` will fail the same way. You can check which answers your container gets with: ```bash docker exec -it <your-3x-ui-container> nslookup www.google.com ``` `2001::1` is 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-322` in `testOutbound`) resolves and validates the outbound test URL before dispatch and returns early on failure, including for `mode=tcp`, where `testOutboundTCP` (`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 a `netsafe` blocked prefix for the test URL's hostname. The enabling change is `b51f0976` (2026-08-19), which added `2001::/32` at `internal/util/netsafe/netsafe.go:24`. Already fixed: Still present on the default branch (`main`, read at `02002dc1`). Not in any release tag — `git tag --contains b51f0976` returns `dev-latest` only. 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:351` `testURL, err := service.SanitizePublicHTTPURL(testURL, false)`; `internal/web/service/url_safety.go:80` `return fmt.Errorf("host %s resolves to blocked private/internal address %s", hostname, ipAddr.IP.String())`; `internal/util/netsafe/netsafe.go:24` `netip.MustParsePrefix("2001::/32"), // Teredo (RFC 4380)`; contrast `internal/util/netsafe/netsafe.go:85-88` (`continue` past blocked addresses) and `:97-102` (fail only when nothing was usable); `internal/web/service/outbound/probe_http.go:171` `if mode == "tcp" && !outboundTransportIsUDP(ob) {`; `internal/web/service/outbound/outbound.go:152` `func (s *OutboundService) testOutboundTCP(outboundJSON string) (*TestOutboundResult, error)`; `internal/web/controller/util.go:172` `m.Msg = msg + " (" + errStr + ")"`; `internal/web/service/setting.go:130` default `https://www.google.com/generate_204`. No test pins the all-or-nothing behaviour: `TestSanitizePublicHTTPURLRejectsPrivateAndBadSchemes` (`internal/web/service/outbound_subscription_test.go:235`) and `TestSanitizePublicHTTPURLBlocksPrivateAddressUnlessAllowed` (`internal/web/service/setting_security_test.go:145`) only use literal IPs, and `TestIsBlockedIP` (`internal/util/netsafe/netsafe_test.go:10`) only covers `IsBlockedIP` itself. Not determined: Why the reporter's resolver answers `2001::1` for `www.google.com` — I cannot run DNS from here. The `nslookup` output 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 in `testOutboundsParsed`, where the URL is actually consumed), and make `rejectPrivateHost` accept a hostname that has at least one non-blocked resolved address, matching `SSRFGuardedDialContext`'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.* <!-- claude-issue:analyst -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4268
No description provided.