CVE-2026-116295: CRLF injection in httpc request headers
Summary
Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') vulnerability in Erlang OTP inets (httpc module) allows HTTP Request Splitting.
httpc writes request header names and values to the wire without neutralizing CR, LF or NUL characters. On the default path httprequest:mkkeyvaluestr/2, and with the headersasis option httpcrequest:httpheaders/2, build each header line by plain concatenation of the name, ": ", the value and CRLF. A CR/LF in a name or value ends the header line early. An attacker who controls data that an application puts into a header passed to httpc:request/4,5 can add or override request headers, or append a second request on the same connection.
Applications that pass only constant or validated header names and values are not affected. The request line is not affected, because uristring rejects URLs that contain raw CR/LF.
This issue affects OTP from OTP 17.0 before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to inets from 5.10 before 9.3.2.9, 9.6.2.5, and 9.8.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.
Proof of concept
1. Start a TCP listener that prints the bytes it receives, for example on localhost:4444. 2. Call httpc:request(get, {"http://localhost:4444", [{"a: b\r\nc", "d\r\ne: f"}]}, [], []). 3. The listener receives three header lines (a: b, c: d, e: f) instead of one. 4. Repeat with [{headersasis, true}] as the fourth argument and an explicit host header. The same three lines arrive.
Impact
An attacker who controls data in a request header can add or override headers such as Authorization, Cookie, Host or X-Forwarded-For, which may affect authentication, routing or caching decisions on the target server or on intermediaries. With an empty line, the attacker can send a second, attacker-chosen request to the target server over the connection that the application opened.
Workarounds
Validate request header names and values before you pass them to httpc:request/4,5. Reject or replace any name or value that contains CR (\r), LF (\n) or NUL (\0), and accept only header names made of RFC 9110 token characters. Where the application forwards headers from another source, use a fixed allowlist of header names.
Other sources
Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') vulnerability in Erlang OTP inets (httpc module) allows HTTP Request Splitting.
httpc writes request header names and values to the wire without neutralizing CR, LF or NUL characters. On the default path httprequest:mkkeyvaluestr/2, and with the headersasis option httpcrequest:httpheaders/2, build each header line by plain concatenation of the name, ": ", the value and CRLF. A CR/LF in a name or value ends the header line early. An attacker who controls data that an application puts into a header passed to httpc:request/4,5 can add or override request headers, or append a second request on the same connection.
Applications that pass only constant or validated header names and values are not affected. The request line is not affected, because uristring rejects URLs that contain raw CR/LF.
This issue affects OTP from OTP 17.0 before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to inets from 5.10 before 9.3.2.9, 9.6.2.5, and 9.8.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Erlang/OTPto a version that resolves this vulnerability.Fixed in 27.3.4.20 - Upgrade
Upgrade
Erlang/OTPto a version that resolves this vulnerability.Fixed in 28.5.0.9 - Upgrade
Upgrade
Erlang/OTPto a version that resolves this vulnerability.Fixed in 29.1.3 - Compensating control
Before passing headers to httpc:request/4,5, reject or replace names or values containing CR, LF, or NUL; accept only RFC 9110 token characters in header names. For headers forwarded from another source, use a fixed allowlist of header names.
Event History
Frequently Asked Questions
Which applications are realistically exposed?
Applications are exposed when attacker-controlled data can reach a header name or value passed to httpc:request/4 or httpc:request/5. Applications that use only constant or validated header names and values are not affected.
What can an attacker do if they control a header value or name?
A CR or LF character can terminate the intended header line, allowing the attacker to add or override request headers. They may also append a second request on the same connection.
Are URLs containing attacker-controlled CR/LF affected through the request line?
No. The request line is not affected because uri_string rejects URLs containing raw CR or LF characters.
What versions contain fixes?
Fixed releases are OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to inets 9.3.2.9, 9.6.2.5, and 9.8.2. OTP releases from 17.0 up to, but not including, those fixed releases are affected; the status of versions before OTP 17.0 is unknown.
What can be done before patching?
Ensure that every header name and value supplied to httpc is constant or validated, and reject or remove CR, LF, and NUL characters from any data that could be placed in a header.