XHTTP over HTTP/3 with `finalmask.quicParams.congestion: "brutal"` panics at the first dial; `-test` passes

Open Beginner friendly
#7,559 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
networking

Research direction

Start with the congestion switch in transport/internet/splithttp/dialer.go around lines 237–244, then check how infra/conf/transport_finalmask.go validates congestion values. Use the provided XHTTP/3 client and server configs to reproduce the panic after the QUIC handshake. Done means brutal either works for this dialer or is rejected during config loading 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).

The config loader accepts congestion: "brutal" (infra/conf/transport_finalmask.go), but the XHTTP/3 dialer's switch (transport/internet/splithttp/dialer.go:237-244) handles only reno, bbr, empty and force-brutal, and ends in default: panic(quicParams.Congestion). So brutal panics (panic: brutal) right after the QUIC handshake. xray run -test prints Configuration OK.

Reproduction Method

Save the client config below as cfg.json and the server config as server.json (both on 127.0.0.1).

# server: xray run -c server.json ; client: xray run -c client.json, then
curl -x socks5h://127.0.0.1:10808 http://127.0.0.1:20001/

Expected result: either brutal is accepted and works for XHTTP/3, or the loader refuses it with a config error; no panic.

(xray run -test on the client config prints Configuration OK, exit 0. The server uses a throwaway self-signed certificate; the client pins its leaf hash.)

Client config


{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 10808,
      "protocol": "socks"
    }
  ],
  "outbounds": [
    {
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "127.0.0.1",
            "port": 20001,
            "users": [
              {
                "id": "c20965b7-c354-405b-a3ef-f886415c9181",
                "encryption": "none"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "xhttp",
        "security": "tls",
        "tlsSettings": {
          "serverName": "localhost",
          "alpn": [
            "h3"
          ],
          "pinnedPeerCertSha256": "208773ca012415a909c508eeaab62107341e8dcb096c649bb3bb50540d1baf62"
        },
        "xhttpSettings": {
          "path": "/p"
        },
        "finalmask": {
          "quicParams": {
            "congestion": "brutal",
            "brutalUp": "10 mbps",
            "brutalDown": "10 mbps"
          }
        }
      }
    }
  ]
}

Server config


{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 20001,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "c20965b7-c354-405b-a3ef-f886415c9181"
          }
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "xhttp",
        "security": "tls",
        "tlsSettings": {
          "certificates": [
            {
              "certificateFile": "/tmp/repro/lab/srv.crt",
              "keyFile": "/tmp/repro/lab/srv.key"
            }
          ],
          "alpn": [
            "h3"
          ]
        },
        "xhttpSettings": {
          "path": "/p"
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ]
}

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:/tmp/repro/cfg/h3brutal-run.json Format:json}
[Warning] core: Xray 26.11.9 started
from tcp:127.0.0.1:46084 accepted tcp:127.0.0.1:20001
panic: brutal

goroutine 53 [running]:
github.com/xtls/xray-core/transport/internet/splithttp.createHTTPClient.func2({0x24c9120, 0x29b4f872ac80}, {0x0?, 0x0?}, 0x29b4f85e5860, 0x29b4f85cc630)
github.com/xtls/xray-core/transport/internet/splithttp/dialer.go:241 +0x6f9
github.com/apernet/quic-go/http3.(*Transport).dial(0x29b4f849c120, {0x24c9120, 0x29b4f872ac80}, {0x29b4f8665ce0, 0xd})
github.com/apernet/[email protected]/http3/transport.go:383 +0x166
github.com/apernet/quic-go/http3.(*Transport).getClient.func1()
github.com/apernet/[email protected]/http3/transport.go:317 +0x71
created by github.com/apernet/quic-go/http3.(*Transport).getClient in goroutine 52
github.com/apernet/[email protected]/http3/transport.go:314 +0x325
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0xda2451]

goroutine 52 [running]:
github.com/apernet/quic-go.(*Conn).RemoteAddr(...)
github.com/apernet/[email protected]/connection.go:3095
github.com/apernet/quic-go/http3.(*fakeConn).RemoteAddr(0x29b4f872ac80?)
github.com/apernet/[email protected]/http3/trace.go:31 +0x11
github.com/xtls/xray-core/transport/internet/splithttp.(*DefaultDialerClient).OpenStream.func1({{0x24d0208?, 0x29b4f84020c8?}, 0xc0?, 0xda?, 0x0?})
github.com/xtls/xray-core/transport/internet/splithttp/client.go:54 +0x4a
github.com/apernet/quic-go/http3.traceGotConn(...)
github.com/apernet/[email protected]/http3/trace.go:36
github.com/apernet/quic-go/http3.(*Transport).doRoundTripOpt(0x29b4f849c120, 0x29b4f852b7c0, {0xd0?}, 0x0)
github.com/apernet/[email protected]/http3/transport.go:234 +0x40a
github.com/apernet/quic-go/http3.(*Transport).roundTripOpt(0x29b4f849c120, 0x29b4f852b7c0, {0x0?})
github.com/apernet/[email protected]/http3/transport.go:211 +0x3db
github.com/apernet/quic-go/http3.(*Transport).RoundTripOpt(...)
github.com/apernet/[email protected]/http3/transport.go:169
github.com/apernet/quic-go/http3.(*Transport).RoundTrip(0x29b4f8782010?, 0x29b4f852b7c0)
github.com/apernet/[email protected]/http3/transport.go:290 +0x1a
net/http.send(0x29b4f852b7c0, {0x24bca20, 0x29b4f849c120}, {0x4a4cea?, 0x7f1ce0cb2808?, 0x0?})
net/http/client.go:266 +0x802
net/http.(*Client).send(0x29b4f8735920, 0x29b4f852b7c0, {0x42e3b4?, 0x2000?, 0x0?})
net/http/client.go:187 +0x27e
net/http.(*Client).do(0x29b4f8735920, 0x29b4f852b7c0)
net/http/client.go:745 +0x992
net/http.(*Client).Do(...)
net/http/client.go:604
github.com/xtls/xray-core/transport/internet/splithttp.(*DefaultDialerClient).OpenStream.func2()
github.com/xtls/xray-core/transport/internet/splithttp/client.go:73 +0xa7
created by github.com/xtls/xray-core/transport/internet/splithttp.(*DefaultDialerClient).OpenStream in goroutine 50
github.com/xtls/xray-core/transport/internet/splithttp/client.go:72 +0x5ea
exit=2

Server log

Server started normally, no warnings (loglevel: warning).

Dominant language
Go
Stars
43.3k
Forks
6.2k
Avg merge
2d 11h
Merged PRs (30d)
55

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from XTLS/Xray-core

All issues in XTLS/Xray-core

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.