CVE-2026-47075
JSON

6.8medium

CR/LF injection in query parameter in hackney

Severity
6.8medium CVSS:4.0 by EEF
Exploit likelihood
0.48% (higher than 42% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
EEF
Also known as
GHSA-j9wq-vxxc-94wfEEF-CVE-2026-47075

Description

Improper Neutralization of CRLF Sequences vulnerability in benoitc hackney allows HTTP Request Splitting. hackney does not percent-encode carriage return (\r) or line feed (\n) characters in the URL query component before constructing the HTTP/1.1 request target. Characters outside the grammar defined in RFC 3986 Section 3.4 must be percent-encoded, but hackney_url:make_url/3 passes the query binary directly without validation or escaping. An attacker who can control all or part of a URL passed to hackney can inject raw CRLF sequences into the query string, which are then sent as HTTP line breaks in the request target. This enables injection of arbitrary HTTP headers or splitting of the HTTP request. This issue affects hackney: from 0.1.0 before 4.0.1.

Affected

Product or packageVersionsReported by
hackneyfrom 0.1.0 before 4.0.1CVE List
benoitc/hackneyfrom 8bb1a359a81ae58567c84f8d24564e9742e6f2bd before ca73dd0aba0ed557449c18288bf07241671a43c9CVE List
hackney (Hex)before 4.0.1, from 0.1.0 before 4.0.1GitHub Advisory Database, Erlang Ecosystem Foundation
https://github.com/benoitc/hackneyfrom 8bb1a359a81ae58567c84f8d24564e9742e6f2bd before ca73dd0aba0ed557449c18288bf07241671a43c9Erlang Ecosystem Foundation
benoitc hackneybefore 4.0.1NVD

All scores

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

Classification

CWE-93

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

What each source says

CVE List

Improper Neutralization of CRLF Sequences vulnerability in benoitc hackney allows HTTP Request Splitting. hackney does not percent-encode carriage return (\r) or line feed (\n) characters in the URL query component before constructing the HTTP/1.1 request target. Characters outside the grammar defined in RFC 3986 Section 3.4 must be percent-encoded, but hackney_url:make_url/3 passes the query binary directly without validation or escaping. An attacker who can control all or part of a URL passed to hackney can inject raw CRLF sequences into the query string, which are then sent as HTTP line breaks in the request target. This enables injection of arbitrary HTTP headers or splitting of the HTTP request. This issue affects hackney: from 0.1.0 before 4.0.1.

GitHub Advisory Database
Summary

hackney_url:make_url/3 passes the URL query component directly into the HTTP/1.1 request target without percent-encoding \r or \n. RFC 3986 §3.4 requires characters outside the query grammar to be percent-encoded, but no validation or escaping occurs. An attacker who controls any portion of the URL passed to hackney can inject raw CRLF sequences into the request line, enabling HTTP header injection or full request splitting.

Details

hackney_url:make_url/3 in src/hackney_url.erl builds the request target by concatenating the path and query binaries. The query string is used as-is — no character-class check, no percent-encoding of \r or \n. When hackney serializes the request, the query value lands verbatim in the GET <path>?<query> HTTP/1.1\r\n request line. A query value containing \r\n terminates the request line early; subsequent bytes are parsed by the server (or any intermediary proxy) as additional header lines or a second request.

A concrete example: a URL with query ?q=x HTTP/1.1\r\nX-Injected: yes\r\nX: produces the following on the wire:

GET /?q=x HTTP/1.1
X-Injected: yes
X: HTTP/1.1
Host: ...

The server sees X-Injected: yes as a legitimate request header that the client never intended to send.

PoC
  1. Listen on a raw TCP port: nc -lvnp 8080.
  2. Issue: :hackney.get("http://127.0.0.1:8080/?q=x HTTP/1.1\r\nX-Injected: yes\r\nX:").
  3. Observe the listener receives X-Injected: yes as a standalone header line in the request.
Impact

HTTP header injection and request splitting against any server hackney connects to. Affects all released versions of hackney before 4.0.1. Exploitation requires an attacker-controlled URL (or URL component) to reach hackney without prior sanitization. Consequences include injecting arbitrary headers (Authorization, Host, X-Forwarded-For) and splitting requests through proxies. CVSS v4.0: 6.8 (MEDIUM).

Resources

Erlang Ecosystem Foundation

Summary

Improper Neutralization of CRLF Sequences vulnerability in benoitc hackney allows HTTP Request Splitting.

hackney does not percent-encode carriage return (\r) or line feed (\n) characters in the URL query component before constructing the HTTP/1.1 request target. Characters outside the grammar defined in RFC 3986 Section 3.4 must be percent-encoded, but hackney_url:make_url/3 passes the query binary directly without validation or escaping. An attacker who can control all or part of a URL passed to hackney can inject raw CRLF sequences into the query string, which are then sent as HTTP line breaks in the request target. This enables injection of arbitrary HTTP headers or splitting of the HTTP request.

This issue affects hackney: from 0.1.0 before 4.0.1.

NVD (es)

Vulnerabilidad de neutralización incorrecta de secuencias CRLF en benoitc hackney permite la división de solicitudes HTTP. hackney no codifica en porcentaje los caracteres de retorno de carro (\r) o salto de línea (\n) en el componente de consulta de la URL antes de construir el objetivo de la solicitud HTTP/1.1. Los caracteres fuera de la gramática definida en la Sección 3.4 de RFC 3986 deben ser codificados en porcentaje, pero hackney_url:make_url/3 pasa el binario de consulta directamente sin validación ni escape. Un atacante que puede controlar la totalidad o parte de una URL pasada a hackney puede inyectar secuencias CRLF sin procesar en la cadena de consulta, las cuales son luego enviadas como saltos de línea HTTP en el objetivo de la solicitud. Esto permite la inyección de encabezados HTTP arbitrarios o la división de la solicitud HTTP. Este problema afecta a hackney: desde 0 antes de 4.0.1.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-47075 changed 2026-11-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-j9wq-vxxc-94wf changed 2026-06-26CC-BY-4.0
Erlang Ecosystem FoundationEEF-CVE-2026-47075 changed 2026-11-25CC-BY-4.0
NVDCVE-2026-47075 changed 2026-11-20Public domain