Behavioral change between 1.12.17 and 1.12.18 breaks IPv6 fallback on IPv4 only network
Operating system
Linux
System version
Fedora Linux 43.20260320.0 (Silverblue)
Installation type
Original sing-box Command Line
If you are using a graphical client, please provide the version of the client.
No response
Version
sing-box version 1.12.18
Environment: go1.25.6 linux/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale
Revision: 58025a01f8091e114f79f2df6267d54682d3e572
CGO: disabled
Description
So basically what's going on is: In an IPv4 only network, an RST is sent if accessing domain with IPv6 address in sing-box version 1.12.18+, but not in previous versions.
This newly introduced behavior breaks IPv6 fallback (all these happy eyeball stuff), severly affecting Chromium and Chromium-based applications.
Reproduction
Use the following configuration file:
config.json:
{
"log": {
"disabled": false,
"level": "trace",
"output": "box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "local",
"type": "udp",
"server": "223.5.5.5"
}
],
"final": "local",
"strategy": "prefer_ipv4",
"disable_cache": false,
"disable_expire": false,
"reverse_mapping": true
},
"inbounds": [
{
"type": "tun",
"tag": "Tun-In",
"address": [
"172.19.0.1/30",
"fdfe:dcba:9876::1/126"
],
"auto_redirect": true,
"auto_route": true,
"strict_route": false
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
}
],
"route": {
"rules": [
{
"action": "sniff"
},
{
"protocol": "dns",
"action": "hijack-dns"
},
{
"ip_is_private": true,
"outbound": "direct"
}
],
"final": "direct",
"auto_detect_interface": true,
"override_android_vpn": false,
"find_process": true,
"default_domain_resolver": "local"
},
"experimental": {
"cache_file": {
"enabled": true
},
"clash_api": {
"external_controller": "127.0.0.1:9090",
"secret": "1145141919810"
}
}
}
With sing-box 1.12.17:
> curl -I -v https://example.org
* Host example.org:443 was resolved.
* IPv6: 2606:4700::6812:318, 2606:4700::6812:218
* IPv4: 104.18.2.24, 104.18.3.24
* Trying [2606:4700::6812:318]:443...
* Immediate connect fail for 2606:4700::6812:318: Network is unreachable
* Trying [2606:4700::6812:218]:443...
* Immediate connect fail for 2606:4700::6812:218: Network is unreachable
* Trying 104.18.2.24:443...
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
* CApath: none
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* closing connection #0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the webpage mentioned above.
> curl -6 -I -v https://example.org
* Host example.org:443 was resolved.
* IPv6: 2606:4700::6812:318, 2606:4700::6812:218
* IPv4: (none)
* Trying [2606:4700::6812:318]:443...
* Immediate connect fail for 2606:4700::6812:318: Network is unreachable
* Trying [2606:4700::6812:218]:443...
* Immediate connect fail for 2606:4700::6812:218: Network is unreachable
* Failed to connect to example.org port 443 after 1 ms: Could not connect to server
* closing connection #0
curl: (7) Failed to connect to example.org port 443 after 1 ms: Could not connect to server
With sing-box 1.12.18:
> curl -I -v https://example.org
* Host example.org:443 was resolved.
* IPv6: 2606:4700::6812:218, 2606:4700::6812:318
* IPv4: 104.18.2.24, 104.18.3.24
* Trying [2606:4700::6812:218]:443...
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
* CApath: none
* Recv failure: Connection reset by peer
* TLS connect error: error:00000000:lib(0)::reason(0)
* OpenSSL SSL_connect: Connection reset by peer in connection to example.org:443
* closing connection #0
curl: (35) Recv failure: Connection reset by peer
> curl -6 -I -v https://example.org
* Host example.org:443 was resolved.
* IPv6: 2606:4700::6812:318, 2606:4700::6812:218
* IPv4: (none)
* Trying [2606:4700::6812:318]:443...
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
* CApath: none
* Recv failure: Connection reset by peer
* TLS connect error: error:00000000:lib(0)::reason(0)
* OpenSSL SSL_connect: Connection reset by peer in connection to example.org:443
* closing connection #0
curl: (35) Recv failure: Connection reset by peer
Wireshark capture shows RST as well:
Logs
+0000 2026-03-20 07:41:31 INFO network: updated default interface eno1, index 2
+0000 2026-03-20 07:41:31 TRACE inbound/tun[Tun-In]: creating stack
+0000 2026-03-20 07:41:31 INFO inbound/tun[Tun-In]: started at tun0
+0000 2026-03-20 07:41:32 INFO clash-api: restful api listening at 127.0.0.1:9090
+0000 2026-03-20 07:41:32 INFO sing-box started (1.22s)
+0000 2026-03-20 07:41:32 INFO router: found process path: /usr/lib/systemd/systemd-resolved, user id: 114514
+0000 2026-03-20 07:41:32 INFO router: found process path: /usr/lib/systemd/systemd-resolved, user id: 114514
+0000 2026-03-20 07:41:32 INFO router: found process path: /usr/lib/systemd/systemd-resolved, user id: 114514
+0000 2026-03-20 07:41:33 INFO router: found process path: /usr/lib/systemd/systemd-resolved, user id: 114514
+0000 2026-03-20 07:41:39 INFO router: found process path: /usr/lib/systemd/systemd-resolved, user id: 114514
+0000 2026-03-20 07:41:39 INFO [1916737794 0ms] inbound/tun[Tun-In]: inbound packet connection from 172.19.0.1:52423
+0000 2026-03-20 07:41:39 INFO [1916737794 0ms] inbound/tun[Tun-In]: inbound packet connection to 172.19.0.2:53
+0000 2026-03-20 07:41:39 INFO [1916737794 0ms] router: found process path: /usr/lib/systemd/systemd-resolved, user id: 114514
+0000 2026-03-20 07:41:39 DEBUG [1916737794 0ms] router: match[0] => sniff
+0000 2026-03-20 07:41:39 DEBUG [1916737794 0ms] router: sniffed packet protocol: dns +0000 2026-03-20 07:41:39 DEBUG [1916737794 0ms] router: match[1] protocol=dns => hijack-dns
+0000 2026-03-20 07:41:39 DEBUG [1916737794 0ms] dns: exchange example.org. IN AAAA +0000 2026-03-20 07:41:39 DEBUG [1916737794 9ms] dns: exchanged example.org NOERROR 111
+0000 2026-03-20 07:41:39 INFO [1916737794 9ms] dns: exchanged AAAA example.org. 111 IN AAAA 2606:4700::6812:318
+0000 2026-03-20 07:41:39 INFO [1916737794 9ms] dns: exchanged AAAA example.org. 111 IN AAAA 2606:4700::6812:218
+0000 2026-03-20 07:41:39 INFO [1916737794 9ms] dns: exchanged OPT OPT PSEUDOSECTION: EDNS: version 0 flags: MBZ: 0x006f, udp: 4096
+0000 2026-03-20 07:41:39 INFO [3404277574 0ms] inbound/tun[Tun-In]: inbound redirect connection from [fdfe:dcba:9876::1]:53038
+0000 2026-03-20 07:41:39 INFO [3404277574 0ms] inbound/tun[Tun-In]: inbound connection to [2606:4700::6812:318]:443
+0000 2026-03-20 07:41:39 INFO [3404277574 8ms] router: found process path: /usr/bin/curl, user: yajuu
+0000 2026-03-20 07:41:39 DEBUG [3404277574 8ms] router: found reserve mapped domain: example.org
+0000 2026-03-20 07:41:39 DEBUG [3404277574 8ms] router: match[0] => sniff
+0000 2026-03-20 07:41:39 DEBUG [3404277574 9ms] router: sniffed protocol: tls, domain: example.org
+0000 2026-03-20 07:41:39 INFO [3404277574 9ms] outbound/direct[direct]: outbound connection to [2606:4700::6812:318]:443
+0000 2026-03-20 07:41:39 ERROR [3404277574 9ms] connection: open connection to [2606:4700::6812:318]:443 using outbound/direct[direct]: dial tcp [2606:4700::6812:318]:443: connect: network is unreachable
Supporter
- [ ] I am a sponsor
Integrity requirements
- [x] I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
- [x] I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
- [x] I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
- [x] I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
This is the expected behavior. For HE to behave correctly, it is your responsibility to use reject to prevent the TCP connection from being established (including sniff action).