GO-2026-7019: go-guerrilla crashes on a bare XCLIENT command (7-byte slice off-by-one panic)

Published Nov 19, 2026
·
Updated

go-guerrilla crashes on a bare XCLIENT command (7-byte slice off-by-one panic) in github.com/phires/go-guerrilla

Other sources

Go-Guerrilla SMTP Daemon is a lightweight SMTP server written in Go. In 1.6.7 and earlier, according to the repository advisory's structured affected range, server.go defines the seven-byte cmdXCLIENT token, but the XCLIENT handler slices input[8:] after matching only that seven-byte verb, so a bare command causes an out-of-bounds panic in handleClient and terminates the daemon because that connection goroutine does not recover the panic. The issue is reachable by an unauthenticated client when the non-default xclienton setting is enabled; no HELO command is required. The repository fix is present in version 1.6.7-1.

— OSV

The defect ---------- Confirmed at HEAD. server.go: cmdXCLIENT = []byte("XCLIENT") is 7 bytes (line 78), so the dispatch match cmdXCLIENT.match(cmd) only guarantees len(input) >= 7. The handler then slices input[8:] (line 586):

case sc.XClientOn && cmdXCLIENT.match(cmd): if toks := bytes.Split(input[8:], []byte{' '}); len(toks) > 0 { // line 586

A client sending the bare command XCLIENT (exactly 7 bytes) hits input[8:7] and panics runtime error: slice bounds out of range [8:7]. handleClient runs in the per-connection goroutine (server.go:391) which has no recover(); the only recover() calls are in the backend mail-processing workers (a different goroutine never reached during command parsing), so the unrecovered panic crashes the whole SMTP daemon.

Input and attacker ------------------- Connect to the SMTP port, then send XCLIENT\r\n (a bare LF also works; no HELO needed). Precondition: xclienton: true (off by default, but a documented nginx-fronted deployment; go-guerrilla does not restrict who may send XCLIENT). Attacker model: any unauthenticated client on the SMTP port.

Verification level ------------------ EXECUTED with a negative control (agent-run, driving the real server.handleClient with XClientOn=true over the suite's mock net.Conn). The bare XCLIENT panics with the exact OOB; the negative control XCLIENT with a trailing space (8 bytes) does not panic and returns 250. The upstream TestXClient tests XCLIENT ADDR=... and XCLIENT c but never the bare 7-byte form (the missing regression case). I independently re-confirmed at HEAD that cmdXCLIENT is 7 bytes (server.go:78), that the handler slices input[8:] (server.go:586), and that handleClient (server.go:391) has no recover. NOT verified: did not stand up a standalone daemon on a real socket to observe OS-level process exit (used the mock net.Conn plus the traced absence of recover; crash-to-exit is standard Go runtime behavior).

Suggested fix ------------- Guard the slice against the exact-verb-length case: require len(input) > len(cmdXCLIENT)+1 (or slice at the verb length and trim) before input[8:]. A recover in the per-connection handleClient loop would also contain any residual command-parse panic to the single connection.

Also checked and SOUND ---------------------- The rfc5321 recursive-descent parser (MAIL/RCPT/HELO/EHLO/address) is bounds-safe (next()/peek() return 0 at EOF), and the line/size/recipient caps are enforced. XCLIENT is the only off-by-one; every other command arm slices exactly at its verb length.

Advisory-source note -------------------- Five-source enumeration (repo advisories, OSV, NVD, the global GitHub DB, no vendor CNA) shows the PROXY-header IP-spoof bug (CVE-2025-31135, fixed v1.6.7) is the only published advisory; this XCLIENT panic is undisclosed and not contested.

Dedup ----- Dedup gate clean: no phires/go-guerrilla blocking verdict in COVERED-INDEX, DISCLOSURE-INDEX or SCOUT-EXCLUDE.

Tooling ------- AI assistance was used while investigating. The panic is executed-verified with a negative control (a bare XCLIENT crashes the real handleClient while XCLIENT with a trailing space returns 250), and the reporter confirmed at HEAD that cmdXCLIENT is 7 bytes while the handler slices input[8:] on a per-connection goroutine with no recover.

— OSV

Affected Software

2 affected componentsFixes available
go/github.com/phires/go-guerrilla=1.6.7
go/github.com/phires/go-guerrilla<1.6.7-1
1.6.7-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/phires/go-guerrilla to a version that resolves this vulnerability.

    Fixed in 1.6.7-1
  2. Upgrade

    Upgrade github.com/phires/go-guerrilla to a version that resolves this vulnerability.

    Fixed in 1.6.7-1
  3. Compensating control

    Add a recover in the per-connection handleClient loop to contain residual command-parse panics to that connection.

Event History

Nov 19, 2026
CVE Published
via OSV·08:09 PM
Data Sourced
via OSV·08:09 PM
DescriptionSeverityWeakness
Nov 20, 2026
Advisory Published
via OSV·02:42 PM
Data Sourced
via OSV·02:42 PM
Affected Software

Frequently Asked Questions

1

Who is exposed to this denial-of-service condition?

Servers with xclient_on set to true are exposed. Any unauthenticated client that can connect to the SMTP port can trigger it; no HELO command is required.

2

Are default deployments affected?

The XCLIENT feature is off by default, so deployments that have not enabled xclient_on are not affected by this command path. The affected configuration is documented for nginx-fronted deployments.

3

What can be done if the fix cannot be deployed immediately?

Disable xclient_on to prevent the vulnerable handler from being reached. Restricting access to the SMTP port to trusted clients also reduces exposure, since any client able to connect can send the triggering command.

4

How can an administrator verify that a server is vulnerable?

On a server with xclient_on enabled, connect to its SMTP port and send a bare XCLIENT command followed by CRLF or LF. A vulnerable server panics with a slice-bounds error and the SMTP daemon crashes.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203