Hysteria outbound without `settings.address` panics with nil pointer dereference at the first dial; `-test` passes
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go
- Domain
- backend, networking
Research direction
Read infra/conf/hysteria.go:24-27, where the Hysteria client config builds its server from settings.address, and check how config validation is tested. Start by running the reported xray run -test -c cfg.json reproduction with the supplied config. Done means a missing address is rejected with a configuration error before the first dial can panic.
Written by the indexing model from the issue text.
Description
Integrity requirements
- I read the issue template.
- I confirm I read the documentation and did not pile up options.
- Complete configs and logs are provided below.
- I searched issues and found no similar ones.
- Reproduced on the latest release.
Description
Version: Xray 26.11.9 (Xray, Penetrates Everything.) 676eaf6 (go1.27.3 linux/amd64), the v26.11.9 release Xray-linux-64.zip (sha256 b651f7e1d9966ee2c1b1ee1bf8b52c72771824d3065dce96bbc8bcc19ed95f82). The panic site is also unchanged on main at 919d0ae (2026-11-30).
infra/conf/hysteria.go:24-27 builds ClientConfig.Server from c.Address.Build() with no check that an address was given. The core starts and xray run -test prints Configuration OK, then the first connection through the outbound panics in transport/internet/tls/config.go:496 (WithDestination, nil destination). The loaded config is not valid, but nothing says so before the process dies.
Reproduction Method
Save the client config below as cfg.json.
xray run -test -c cfg.json # then: xray run -c cfg.json, and in another shell: curl -x socks5h://127.0.0.1:10808 http://example.com/
Expected result: xray run -test fails with a config error (hysteria: address is empty or similar); no panic at dial.
Client config
{
"log": {
"loglevel": "warning"
},
"outbounds": [
{
"protocol": "hysteria",
"settings": {
"version": 2
},
"streamSettings": {
"network": "hysteria",
"security": "tls",
"tlsSettings": {
"serverName": "example.com",
"alpn": [
"h3"
]
},
"hysteriaSettings": {
"version": 2,
"auth": "x"
}
}
}
],
"inbounds": [
{
"listen": "127.0.0.1",
"port": 10808,
"protocol": "socks",
"settings": {
"udp": false
}
}
]
}
Server config
Not needed: the client config panics on its own.
Client log
Full output of the panicking process (ends with the exit code):
Xray 26.11.9 (Xray, Penetrates Everything.) 676eaf6 (go1.27.3 linux/amd64)
A unified platform for anti-censorship.
[Info] infra/conf/serial: Reading config: &{Name:../cfg/hyst.json Format:json}
Configuration OK.
exit=0
Xray 26.11.9 (Xray, Penetrates Everything.) 676eaf6 (go1.27.3 linux/amd64) A unified platform for anti-censorship. [Info] infra/conf/serial: Reading config: &{Name:/tmp/repro/cfg/hyst.json Format:json} [Warning] core: Xray 26.11.9 started from tcp:127.0.0.1:58286 accepted tcp:127.0.0.1:20001 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xca24a5]
goroutine 27 [running]:
github.com/xtls/xray-core/transport/internet/tls.WithDestination.func1(0x18afcdeb25a0)
github.com/xtls/xray-core/transport/internet/tls/config.go:496 +0x25
github.com/xtls/xray-core/transport/internet/tls.(*Config).GetTLSConfig(0x18afcdbdd760, {0x18afcdd272c0, 0x1, 0x0?})
github.com/xtls/xray-core/transport/internet/tls/config.go:408 +0x538
github.com/xtls/xray-core/transport/internet/hysteria.Dial({0x24c9158, 0x18afcddc2480}, {{0x0?, 0x0?}, 0x0?, 0x0?}, 0x18afcdbd1030)
github.com/xtls/xray-core/transport/internet/hysteria/dialer.go:358 +0x371
github.com/xtls/xray-core/transport/internet.Dial({0x24c9158, 0x18afcddc2480}, {{0x0?, 0x0?}, 0x0?, 0x2?}, 0x18afcdbd1030?)
github.com/xtls/xray-core/transport/internet/dialer.go:63 +0x168
github.com/xtls/xray-core/app/proxyman/outbound.(*Handler).Dial(0x18afcddbcd00, {0x24c9158?, 0x18afcddc2480?}, {{0x0?, 0x0?}, 0x0?, 0x0?})
github.com/xtls/xray-core/app/proxyman/outbound/handler.go:275 +0x11d
github.com/xtls/xray-core/proxy/hysteria.(*Client).Process(0x18afcdd7c990, {0x24c9158, 0x18afcddc2450}, 0x18afcdcea280, {0x24c7308, 0x18afcddbcd00})
github.com/xtls/xray-core/proxy/hysteria/client.go:63 +0x21c
github.com/xtls/xray-core/app/proxyman/outbound.(*Handler).Dispatch(0x18afcddbcd00, {0x24c9158, 0x18afcddc2450}, 0x18afcdcea280)
github.com/xtls/xray-core/app/proxyman/outbound/handler.go:239 +0x98a
github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).routedDispatch(0x18afcdd7fea0, {0x24c9158, 0x18afcddc2450}, 0x18afcdcea280, {{0x24c9628, 0x18afcdb38244}, 0x4e21, 0x2})
github.com/xtls/xray-core/app/dispatcher/default.go:507 +0xc52
github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).DispatchLink(0x18afcdd7fea0, {0x24c9158, 0x18afcddc2450}, {{0x24c9628?, 0x18afcdb38244?}, 0xd008?, 0x18af?}, 0x18afcdcea280)
github.com/xtls/xray-core/app/dispatcher/default.go:344 +0x506
github.com/xtls/xray-core/common/mux.(*Server).DispatchLink(0x20?, {0x24c9158?, 0x18afcddc2450?}, {{0x24c9628?, 0x18afcdb38244?}, 0xa1a0?, 0x18af?}, 0x2?)
github.com/xtls/xray-core/common/mux/server.go:64 +0xda
github.com/xtls/xray-core/proxy/socks.(*Server).processTCP(0x18afcddc26c0, {0x24c9158, 0x18afcddc2240}, {0x73b3c67c1e00, 0x18afcdd100b8}, {0x24ca4f0, 0x18afcdb48e00}, {0x18afcdb38178, 0x1, 0x1})
github.com/xtls/xray-core/proxy/socks/server.go:157 +0xf4b
github.com/xtls/xray-core/proxy/socks.(*Server).Process(0x18afcddc26c0, {0x24c9158, 0x18afcddc2240}, 0x2, {0x73b3c67c1e00, 0x18afcdd100b8}, {0x24ca4f0, 0x18afcdb48e00})
github.com/xtls/xray-core/proxy/socks/server.go:91 +0x2a5
github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).callback(0x18afcddc8000, {0x73b3c67c1e00, 0x18afcdd100b8})
github.com/xtls/xray-core/app/proxyman/inbound/worker.go:123 +0xde3
created by github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).Start.func1 in goroutine 26
github.com/xtls/xray-core/app/proxyman/inbound/worker.go:142 +0x86
exit=2
Server log
Not applicable.
- Dominant language
- Go
- Stars
- 43.3k
- Forks
- 6.2k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 55
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from XTLS/Xray-core
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
XDRIVE: S3兼容存储因先删除非空父目录再删子文件报错412Possibly taken @earmark-halt claimed this 16 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
XTLS/Xray-core#7428 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/crabbox#3249 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
ec2-subnet, security-group and internet-gateway skip all resources when one is deleted during the scanPossibly taken @toabctl claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
gruntwork-io/cloud-nuke#1208 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
snowflakedb/gosnowflake#1872 ·
-
MCP `shadow` says `out` is a folder, but for TS, Python, C, Go and Ruby it is the module's fileOpengood first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
erkamyaman/rust-anything#1328 ·
Maintainers usually reply within 1 day