Go tcp4 Default Triggers Linux Kernel RCE via MPTCP (CVE-2026-98432)
This article analyzes CVE-2026-98432, where Go 1.24's default MPTCP enablement on tcp4 listeners triggers a Linux kernel use-after-free vulnerability, allowing remote root code execution; it explains the kernel flaw, demonstrates detection via ss -M, and provides mitigation steps including GODEBUG=multipathtcp=0 and kernel upgrades.
In late October, the Go security team issued an advisory about CVE-2026-98432. The vulnerability originates in the Linux kernel, yet the mitigation requires changing a Go GODEBUG setting. This discrepancy stems from a single line of code commonly used in Go services: ln, err := net.Listen("tcp4", addr) Anthropic demonstrated remote root command execution on a Linux machine with a vulnerable kernel and multipath TCP (MPTCP) enabled. Notably, a project may not reference MPTCP explicitly; the Listen call above is sufficient for the standard library to attempt opening an MPTCP port.
What the "4" in tcp4 Controls
The 4 specifies the address family (IPv4). Whether a connection uses multiple network paths is governed by a separate switch. In Go 1.24, the default value of multipathtcp was changed to 2. This value only causes the server to attempt MPTCP when listening; clients dial normally. If the kernel lacks MPTCP support or socket creation fails, the standard library falls back to regular TCP.
References: Go 1.24 default value explanation (https://go.dev/doc/godebug#go-124) · net package fallback code (https://go.dev/src/net/mptcpsock_linux.go)
Running the Same Service Twice
The following minimal program listens on localhost:18080 and returns 401 for every request. The -plain flag disables MPTCP via SetMultipathTCP(false).
package main
import (
"context"
"flag"
"log"
"net"
"net/http"
)
func main() {
plain := flag.Bool("plain", false, "disable MPTCP on this listener")
flag.Parse()
var cfg net.ListenConfig
if *plain {
cfg.SetMultipathTCP(false)
}
ln, err := cfg.Listen(context.Background(), "tcp4", "127.0.0.1:18080")
if err != nil {
log.Fatal(err)
}
log.Printf("listen=%s wantMPTCP=%t", ln.Addr(), cfg.MultipathTCP())
reject := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
http.Error(w, "token required", http.StatusUnauthorized)
})
log.Fatal(http.Serve(ln, reject))
}Build and run with Go 1.24 or newer:
go mod init example.com/listencheck
go mod edit -go=1.24
go build -o listencheck .
./listencheckIn another terminal, use ss -Mln 'sport = :18080' to list MPTCP sockets. Stop the first run, then start with ./listencheck -plain and query again. On macOS with Go 1.24.1 both runs return 401, but the log shows wantMPTCP changing from true to false. On Linux, the first run may appear in the MPTCP list while the second disappears, yet both respond to curl.
The field is named wantMPTCP because cfg.MultipathTCP() reflects Go's configuration; whether the kernel actually granted an MPTCP socket is visible via ss. See ListenConfig.MultipathTCP documentation (https://pkg.go.dev/net#ListenConfig.MultipathTCP).
Handshake Not Complete, Who Freed the Memory?
The Linux kernel patch reveals the problematic memory region. Client SYN packets may carry IP options in the IPv4 header; the kernel stores them on the request socket representing the half-open connection. When the handshake completes, tcp_v4_syn_recv_sock() passes the pointer to the newly created child socket, avoiding a copy.
These IP options are distinct from the TCP options used for MPTCP negotiation. See Linux kernel patch (https://github.com/torvalds/linux/commit/e3f33b0a1d89d738e2b913dab519226eaf76e15b).
The easily missed detail is the retransmission on the left. CPU A processes a retransmitted SYN, prepares another SYN+ACK, and already holds the option pointer. Meanwhile CPU B finishes the handshake, destroys the child socket, and frees the options it took over. CPU A proceeds to read the option length, accessing already-freed memory.
Code inspection shows CPU A enters rcu_read_lock(). The bug lies on the release side. The patch changes a single line in inet_sock_destruct():
- kfree(rcu_dereference_protected(inet->inet_opt, 1));
+ kfree_rcu(rcu_dereference_protected(inet->inet_opt, 1), rcu);The old kfree() returns memory immediately, not waiting for CPU A. Switching to kfree_rcu() defers reclamation until after an RCU grace period, giving prior readers time to exit. The request socket destructor is also patched because request migration shares the same options. See kernel team's explanation of the two races (https://lists.openwall.net/linux-cve-announce/2026/10/15/1).
Anthropic exploited the same use-after-free twice: first leaking a kernel pointer in 48 minutes by forcing extra data in the response, then overwriting a callback pointer to achieve root command execution in 5 more minutes. Failed races may only manifest as handshake failures, allowing retries that never reach HTTP — hence 401 counts in access logs miss these attempts. See research team's experiment log (https://www.anthropic.com/research/discovering-vulnerabilities-with-claude).
Port Closed, But Kernel Still Vulnerable
A Go issue proposed disabling MPTCP by default. Maintainers highlighted the limitation: the public demonstration used MPTCP listening, but the faulty release logic resides in the regular IPv4 TCP handshake.
Red Hat provides a concrete example: their RHEL default disables MPTCP, yet machines with the affected kernel still require patching. See Go community discussion (https://github.com/golang/go/issues/82717) · Red Hat security advisory (https://access.redhat.com/security/vulnerabilities/RHSB-2026-016).
To audit your service, run ss -Mlnp in its network namespace to match listening addresses, ports, and processes. For Pods, enter the Pod's network namespace; checking only the host's default namespace misses Pod ports.
If an exposed Go MPTCP listener is found and kernel upgrade must wait for a maintenance window, set GODEBUG=multipathtcp=0 in the service startup environment (comma-separate if other GODEBUG flags exist). After a rolling restart, verify the port disappears from the MPTCP list. If it persists, search code and dependencies for SetMultipathTCP(true) — explicit per-listener settings override the default. See Go security team's mitigation advice (https://seclists.org/oss-sec/2026/q4/437).
The upstream fix traces back to Linux 4.4. For the 6.12 branch, the fix landed in 6.12.113, but distributions may backport patches to older versions. Comparing upstream version numbers directly against production machines often leads to errors. After installing a new package, confirm the machine has booted into the patched kernel. Standard Linux containers share the host kernel; rebuilding the application image does not update the kernel that processes SYN packets. See Linux upstream fixed versions (https://lists.openwall.net/linux-cve-announce/2026/10/15/1) · Amazon Linux update notes (https://aws.amazon.com/security/security-bulletins/2026-160-aws/).
Summary
If someone claims "the Go service has been re-released", ask them to run uname -r on the node running the service. Matching the running kernel version against the distribution's fixed package announcement is the only true resolution.
References
Go security team email: https://seclists.org/oss-sec/2026/q4/437
Go 1.24 default value explanation: https://go.dev/doc/godebug#go-124
net package fallback code: https://go.dev/src/net/mptcpsock_linux.go
Go compatibility rules: https://go.dev/doc/godebug#default
ListenConfig.MultipathTCP documentation: https://pkg.go.dev/net#ListenConfig.MultipathTCP
Linux kernel patch: https://github.com/torvalds/linux/commit/e3f33b0a1d89d738e2b913dab519226eaf76e15b
Kernel team's explanation of the two races: https://lists.openwall.net/linux-cve-announce/2026/10/15/1
Research team's experiment log: https://www.anthropic.com/research/discovering-vulnerabilities-with-claude
Go community discussion: https://github.com/golang/go/issues/82717
Red Hat security advisory: https://access.redhat.com/security/vulnerabilities/RHSB-2026-016
Amazon Linux update notes: https://aws.amazon.com/security/security-bulletins/2026-160-aws/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
