CVE-2026-90588: Out-of-bounds read in Zephyr HTTP client debug logging of response header fields
The HTTP client's debug helper printheaderfield() in subsys/net/lib/http/httpclient.c formatted an httpparser data-callback slice with a %s conversion: snprintk(output, len + 1, "%s", str). The parser hands its callbacks a pointer and a length into the caller's receive buffer, and those bytes are not NUL terminated. The size argument of snprintk() bounds only the destination, while the %s conversion measures the source first — lib/os/cbprintfcomplete.c uses strlen() when no precision is given, and lib/os/cbprintfnano.c uses strlen() unconditionally — so the read walks past the end of the header field and past the end of the receive buffer until it finds a zero byte.
The slice reaches the helper from onurl(), onheaderfield() and onheadervalue(), which the parser invokes on bytes that httpwaitdata() read straight off the socket into the application-supplied recvbuf. A malicious or compromised HTTP server, or an attacker able to answer a plaintext request, therefore controls both the header field and the bytes that follow it in the buffer, and can guarantee that no zero byte appears before the buffer ends, forcing the over-read. The in-tree tests/net/lib/httpclient suite reproduces the over-read under CONFIGASAN=y on an ordinary GET.
The impact is bounded. The whole helper body is compiled only when the HTTP client log module is explicitly set to Debug (CONFIGNETHTTPLOGLEVELDBG=y, which the global CONFIGLOGDEFAULTLEVEL does not set), so default builds are unaffected. No out-of-bounds write occurs and none of the over-read bytes are emitted into the log, so there is no information disclosure; the consequence is an out-of-bounds read that can fault and panic the device where the buffer abuts an unmapped or MPU/MMU-protected region.
The fix copies exactly the len bytes the parser offered with memcpy() and terminates them, instead of relying on a %s conversion (a %.s precision would not have sufficed, since cbprintfnano.c measures the source in full before applying it).
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Disable the HTTP client Debug log module so the vulnerable debug helper is not compiled.
Zephyr HTTP client CONFIG_NET_HTTP_LOG_LEVEL_DBG = n
Event History
Frequently Asked Questions
Who can trigger the issue in a deployed client?
A malicious or compromised HTTP server can trigger it when the client processes its response. An attacker able to answer a plaintext HTTP request can also do so.
What does an attacker need to control?
The attacker needs to control HTTP response header data and arrange for no zero byte to appear before the end of the application-supplied receive buffer. The affected callback data originates from bytes read directly from the socket into that buffer.
What is the documented impact?
The reported impact is an out-of-bounds read that can affect availability. The supplied vector reports no confidentiality or integrity impact and an availability impact of low.