VLESS outbound: malformed `encryption` (mlkem768x25519plus.… with no key segment) panics with slice bounds out of range at config load
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read infra/conf/vless.go around the reported checks and slice operation in VLessOutboundConfig.Build; the issue provides two malformed encryption values that reproduce the panic. Start by running xray run -test -c cfg.json with the supplied config, then check existing VLESS outbound tests for a place to cover both cases. Done means both inputs return a config error without panicking.
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).
A VLESS outbound whose encryption starts with mlkem768x25519plus.<mode>.<0rtt|1rtt>. but has no 32/1184-byte key segment is accepted by the parser's first checks and then sliced past the end of the string (infra/conf/vless.go:342-352: segments shorter than 20 characters are counted as padding, and account.Encryption[padding:] is taken without checking that a key segment remains). The process panics while loading the config instead of reporting unsupported "encryption". Both mlkem768x25519plus.native.0rtt. (slice bounds out of range [1:0]) and mlkem768x25519plus.native.0rtt.abc ([4:3]) reproduce.
Reproduction Method
Save the client config below as cfg.json.
xray run -test -c cfg.json
Expected result: a config error (for example VLESS users: unsupported "encryption": ...), no panic. Same for xray run.
Client config
{
"log": {
"loglevel": "warning"
},
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "192.0.2.1",
"port": 443,
"users": [
{
"id": "00000000-0000-4000-8000-000000000000",
"encryption": "mlkem768x25519plus.native.0rtt."
}
]
}
]
}
}
]
}
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/enc.json Format:json} panic: runtime error: slice bounds out of range [1:0]
goroutine 1 [running]:
github.com/xtls/xray-core/infra/conf.(*VLessOutboundConfig).Build.func1(...)
github.com/xtls/xray-core/infra/conf/vless.go:370
github.com/xtls/xray-core/infra/conf.(*VLessOutboundConfig).Build(0x3a21a9a39860)
github.com/xtls/xray-core/infra/conf/vless.go:373 +0x11c5
github.com/xtls/xray-core/infra/conf.(*OutboundDetourConfig).Build(0x3a21a986f860)
github.com/xtls/xray-core/infra/conf/xray.go:395 +0xd48
github.com/xtls/xray-core/infra/conf.(*Config).Build(0x3a21a9a46580)
github.com/xtls/xray-core/infra/conf/xray.go:749 +0x1f25
github.com/xtls/xray-core/infra/conf/serial.BuildConfig({0x3a21a9b10200?, 0x23b9e38?, 0x3a21a986fb50?})
github.com/xtls/xray-core/infra/conf/serial/builder.go:66 +0x2a
github.com/xtls/xray-core/core.LoadConfig({0x1417b55, 0x4}, {0x23372e8?, 0x3a21a98cf008?})
github.com/xtls/xray-core/core/config.go:150 +0x573
main.startXray()
github.com/xtls/xray-core/main/run.go:225 +0x15c
main.executeRun(0x25b6c50?, {0x3a21a98d2020?, 0x25b6c88?, 0x80000025b6c88?})
github.com/xtls/xray-core/main/run.go:83 +0x130
github.com/xtls/xray-core/main/commands/base.Execute()
github.com/xtls/xray-core/main/commands/base/execute.go:65 +0x708
main.main()
github.com/xtls/xray-core/main/main.go:22 +0x1b2
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 78/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
-
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