CVE-2026-43966
JSON

6.3medium

HTTP Response Splitting via Non-VCHAR Bytes in cow_http_struct_hd:escape_string/2

Severity
6.3medium CVSS:4.0 by EEF
Exploit likelihood
0.32% (higher than 27% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
EEF
Also known as
GHSA-w4f7-4cxr-rv3cEEF-CVE-2026-43966

Description

Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') vulnerability in ninenines cowlib allows HTTP response splitting via non-VCHAR bytes in structured-fields string values. cow_http_struct_hd:escape_string/2 in cowlib only escapes \ and ", passing all other bytes through verbatim. This creates an encoder/decoder asymmetry: the matching parser accepts only printable ASCII (0x20–0x7E, excluding " and \), but the encoder emits any byte including CR and LF. An application that builds a structured HTTP header via cow_http_struct_hd:item/1 (or a higher-level wrapper such as cow_http_hd:wt_protocol/1) from attacker-controlled input can have \r\n injected into the serialized header value. Once on the wire, the injected CRLF terminates the current header and any following bytes are interpreted as a new header, enabling HTTP response splitting. This issue affects cowlib: from 2.9.0 before 2.22.0.

Affected

Product or packageVersionsReported by
cowlibfrom 2.9.0 before 2.22.0CVE List
ninenines/cowlibfrom a8b793db3d6ffe91d62f81baf41b1dab4cd78fb6 before 4401b858f2229abb3ea115c60924f6c77e5f8aa3CVE List
cowboy (Hex)before 2.16.0GitHub Advisory Database
gun (Hex)before 2.4.0GitHub Advisory Database
cowlib (Hex)from 2.9.0 before 2.22.0Erlang Ecosystem Foundation
https://github.com/ninenines/cowlibfrom a8b793db3d6ffe91d62f81baf41b1dab4cd78fb6 before 4401b858f2229abb3ea115c60924f6c77e5f8aa3Erlang Ecosystem Foundation
ninenines cowlibfrom 2.9.0 before 2.16.0NVD

All scores

EEF6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N
Erlang Ecosystem FoundationNot scored CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-113

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') vulnerability in ninenines cowlib allows HTTP response splitting via non-VCHAR bytes in structured-fields string values. cow_http_struct_hd:escape_string/2 in cowlib only escapes \ and ", passing all other bytes through verbatim. This creates an encoder/decoder asymmetry: the matching parser accepts only printable ASCII (0x20–0x7E, excluding " and \), but the encoder emits any byte including CR and LF. An application that builds a structured HTTP header via cow_http_struct_hd:item/1 (or a higher-level wrapper such as cow_http_hd:wt_protocol/1) from attacker-controlled input can have \r\n injected into the serialized header value. Once on the wire, the injected CRLF terminates the current header and any following bytes are interpreted as a new header, enabling HTTP response splitting. This issue affects cowlib: from 2.9.0 before 2.22.0.

GitHub Advisory Database

Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') vulnerability in ninenines cowlib allows HTTP response splitting via non-VCHAR bytes in structured-fields string values.

cow_http_struct_hd:escape_string/2 in cowlib only escapes \ and ", passing all other bytes through verbatim. This creates an encoder/decoder asymmetry: the matching parser accepts only printable ASCII (0x20–0x7E, excluding " and ), but the encoder emits any byte including CR and LF. An application that builds a structured HTTP header via cow_http_struct_hd:item/1 (or a higher-level wrapper such as cow_http_hd:wt_protocol/1) from attacker-controlled input can have \r\n injected into the serialized header value. Once on the wire, the injected CRLF terminates the current header and any following bytes are interpreted as a new header, enabling HTTP response splitting.

This issue affects cowlib from 2.9.0.

Erlang Ecosystem Foundation

Summary

Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') vulnerability in ninenines cowlib allows HTTP response splitting via non-VCHAR bytes in structured-fields string values.

cow_http_struct_hd:escape_string/2 in cowlib only escapes \ and ", passing all other bytes through verbatim. This creates an encoder/decoder asymmetry: the matching parser accepts only printable ASCII (0x20–0x7E, excluding " and \), but the encoder emits any byte including CR and LF. An application that builds a structured HTTP header via cow_http_struct_hd:item/1 (or a higher-level wrapper such as cow_http_hd:wt_protocol/1) from attacker-controlled input can have \r\n injected into the serialized header value. Once on the wire, the injected CRLF terminates the current header and any following bytes are interpreted as a new header, enabling HTTP response splitting.

This issue affects cowlib: from 2.9.0 before 2.22.0.

Workarounds

Validate all values passed into structured-fields header builders (directly via cow_http_struct_hd:item/1 or indirectly via higher-level wrappers) before calling the encoder. Reject any value that is not from a trusted, application-controlled source or that contains CR (\r) or LF (\n) bytes.

Applications using cowboy 2.16.0 or later are protected on the server side by the invalid_response_headers option (defaults to error_terminate), which rejects any outgoing response header value containing CR or LF before it reaches the wire. Applications using gun 2.4.0 or later are protected on the client side by the invalid_request_headers request option (defaults to raise), which raises an exception when an outgoing request header value contains CR or LF.

Configurations

The application must pass attacker-controlled data as a string value into cow_http_struct_hd:item/1 (or a wrapper that delegates to it). Applications that construct structured-fields header values exclusively from trusted, application-controlled values are not affected.

NVD (es)

La vulnerabilidad de Neutralización Incorrecta de Secuencias CRLF en Encabezados HTTP ('División de Solicitud/Respuesta HTTP') en ninenines cowlib permite la división de respuesta HTTP a través de bytes no VCHAR en valores de cadena de campos estructurados. cow_http_struct_hd:escape_string/2 en cowlib solo escapa \ y ", pasando todos los demás bytes textualmente. Esto crea una asimetría de codificador/decodificador: el analizador coincidente acepta solo ASCII imprimible (0x20-0x7E, excluyendo " y \), pero el codificador emite cualquier byte, incluidos CR y LF. Una aplicación que construye un encabezado HTTP estructurado a través de cow_http_struct_hd:item/1 (o un envoltorio de nivel superior como cow_http_hd:wt_protocol/1) desde una entrada controlada por el atacante puede tener \r\n inyectado en el valor del encabezado serializado. Una vez en la red, el CRLF inyectado termina el encabezado actual y cualquier byte siguiente se interpreta como un nuevo encabezado, lo que permite la división de respuesta HTTP. Este problema afecta a cowlib desde la versión 2.9.0.

References

https://github.com/ninenines/cowboy/commit/f77cb9b5e730e300fffb551db1ba5d1c4ed878efmitigation, patch, web
https://cna.erlef.org/cves/CVE-2026-43966.htmlrelated, third-party-advisory, web
https://osv.dev/vulnerability/EEF-CVE-2026-43966related, third-party-advisory, web
https://github.com/ninenines/gun/commit/4f35609eb37109b106a863fc9ba83d7ee64e3e42mitigation, patch, web
https://github.com/ninenines/cowlib/commit/a8b793db3d6ffe91d62f81baf41b1dab4cd78fb6related, web
https://github.com/ninenines/cowlib/commit/4401b858f2229abb3ea115c60924f6c77e5f8aa3fix, patch, web
https://nvd.nist.gov/vuln/detail/CVE-2026-43966advisory
https://github.com/ninenines/cowlib/pull/163#issuecomment-4952645232web
https://github.com/ninenines/cowlib/pull/166#issuecomment-5067554701web
https://github.com/ninenines/cowlibpackage
https://hex.pm/packages/cowlibpackage

Sources

SourceRecordLicence
CVE ListCVE-2026-43966 changed 2026-11-19CVE Terms of Use
GitHub Advisory DatabaseGHSA-w4f7-4cxr-rv3c changed 2026-11-12CC-BY-4.0
Erlang Ecosystem FoundationEEF-CVE-2026-43966 changed 2026-11-25CC-BY-4.0
NVDCVE-2026-43966 changed 2026-11-09Public domain