Technical impact
Improper Neutralization of CRLF Sequences in HTTP Headers, known as HTTP Request/Response Splitting, allows attackers to cause HTTP response splitting via non‑VCHAR bytes in structured‑fields string values. In cowlib, the function cow_http_struct_hd:escape_string/2 only escapes backslash and double‑quote characters, passing all other bytes through unchanged. This creates an encoder/decoder asymmetry: the parser accepts only printable ASCII characters, whereas the encoder can emit any byte, including carriage return and line feed. An attacker that supplies attacker‑controlled input to a header builder such as cow_http_struct_hd:item/1 or higher‑level wrappers like cow_http_hd:wt_protocol/1 can inject CRLF sequences into the serialized header value. When transmitted, the injected CRLF terminates the current header and turns any following bytes into a new header, enabling response‑splitting attacks that could lead to header injection, cache poisoning, or cross‑site scripting. This weakness is classified as CWE‑113.
Affected Systems
The vulnerability affects cowlib versions from 2.9.0 up to, but not including, 2.22.0. Applications that depend on cowlib directly, or through higher‑level frameworks such as cowboy 2.16.0+ and gun 2.4.0+, are potentially exposed. Practical mitigation is available through framework configuration: cowboy can use the invalid_response_headers option set to error_terminate, while gun can use invalid_request_headers set to raise. When these options are enabled they prevent the injection of CR or LF bytes; otherwise untrusted header values remain vulnerable.
Risk and Exploitability
With a CVSS score of 6.3 the vulnerability is considered moderate severity. The EPSS score is below 1%, indicating a very low probability of exploitation at present. It is not listed in the CISA KEV catalog, so no active exploitation has been reported. The attack requires an attacker to supply or influence header values constructed by the application – for example, by sending crafted requests that include untrusted input to be encoded into structured HTTP headers, which can then inject CRLF sequences and cause response splitting.
Github GHSA