Home/Research/Post

GHSA-hghq-53p7-c582: go-guerrilla crashes on a bare XCLIENT command (7-byte slice off-by-one panic)

  • Severity: HIGH
  • CVE: CVE-2026-115578
  • Ecosystems: go, go
  • Packages: github.com/phires/go-guerrilla, github.com/phires/go-guerrilla

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: xclient_on: 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…

Source: GitHub Security Advisories · 2026-11-20