The Wire · Showcase
NET/TEXTPROTO INJECTION FLAW OPENS ERROR MESSAGES TO ATTACKER CONTROL
By RepoJournal · Filed · About Go
An attacker can inject arbitrary content into errors returned by net/textproto when external input reaches the package unescaped, potentially exploiting HTTP clients that parse untrusted server headers.
The net/textproto package has been including user-controlled input directly in error messages without escaping [1]. This matters because HTTP clients naturally use ReadMIMEHeader to parse headers from servers, meaning an attacker controlling a server response can craft malicious header content that propagates through error strings. This is a real injection vector for applications that log or expose errors to downstream systems.
On the compiler side, Go's optimization pipeline got smarter about amd64 code generation [2]. The fix removes unnecessary roundtrips between flags, booleans, and flags again, cleaning up bloated generated assembly and improving both code size and efficiency. This is the kind of surgical optimization that accumulates into measurable wins across large binaries.
Escape analysis also tightened up: singly-assigned function variables can now be recognized as static [3], which means recursive closures won't pessimistically escape heap allocations anymore. QUIC's MAX_DATA frame handling got corrected [4] where sentLimit was being incorrectly accumulated instead of properly updated to reflect the last value sent to peers.
Action items
- → Review any code using net/textproto that exposes error output; patch incoming golang/go [immediate]
- → Monitor next Go release for the escape analysis and compiler improvements golang/go [monitor]
- → If running QUIC-backed services, watch for the sentLimit fix in net module updates golang/net [plan]
References
- [1] net/textproto: escape arbitrary input when including them in errors golang/go
- [2] cmd/compile: remove flags → bool → flags roundtrips on amd64 golang/go
- [3] cmd/compile: treat singly-assigned func vars as static in escape analysis golang/go
- [4] quic: fix appendMaxDataFrame erroneously accumulating sentLimit golang/net
FAQ
- What changed in Go on May 16, 2026?
- An attacker can inject arbitrary content into errors returned by net/textproto when external input reaches the package unescaped, potentially exploiting HTTP clients that parse untrusted server headers.
- What should Go teams do about it?
- Review any code using net/textproto that exposes error output; patch incoming • Monitor next Go release for the escape analysis and compiler improvements • If running QUIC-backed services, watch for the sentLimit fix in net module updates
- Which Go repositories shipped on May 16, 2026?
- golang/go, golang/net