CVE-2026-47069

CRLF injection in cookie domain/path options in hackney

Published May 25, 2026 CVSS 4.0 · 2.1 Low EPSS < 1% KEV · Not listed
Description
Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Response Splitting.

The hackney_cookie:setcookie/3 function in src/hackney_cookie.erl validates the Name and Value arguments against CRLF and control characters, but concatenates the domain and path options verbatim into the output iolist with no equivalent check. An attacker who controls either option — for example by supplying a Host header value forwarded as the cookie domain, or a request path forwarded as the cookie path — can inject a literal CRLF sequence and arbitrary additional Set-Cookie headers into the HTTP response.

This issue affects hackney: from 0.9.0 before 4.0.1.

Analysis

AI-generated

Technical impact

The vulnerability is an improper neutralization of CRLF sequences in the domain and path options of the hackney_cookie:setcookie/3 function. The function validates the cookie name and value, but concatenates the domain and path options without checking for CRLF or control characters. An attacker who can control either option—such as forwarding a Host header as the cookie domain or a request path as the cookie path—can inject a literal CRLF sequence, creating arbitrary additional Set-Cookie headers in the HTTP response. This allows HTTP Response Splitting, potentially contaminating downstream cookie handling, though it does not grant code execution or privilege escalation.

Affected Systems

Applications that depend on the Hackney HTTP client library, specifically versions from 0.9.0 up to, but not including, 4.0.1, are affected. Any Erlang or Elixir project that employs hackney to send HTTP requests and sets cookies using the stated function is at risk.

Risk and Exploitability

The CVSS score of 2.1 reflects a low severity assessment. The EPSS score is < 1% (approximately 0.425%), and the vulnerability is not listed in the CISA KEV catalog, indicating no current widespread exploitation. However, the attack vector is remote and relies on the ability to supply a controlled host header or request path that propagates into the cookie domain or path. If an attacker can achieve this control—for example, by influencing client requests or using proxy settings—they can inject CRLF sequences and alter server responses. The likelihood of successful exploitation depends on the presence of a path that is forwarded unfiltered to hackney, which is a relatively common scenario in web applications that forward client headers for subdomain cookie setting.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Hackney to version 4.0.1 or later, which contains the proper sanitization of domain and path options.
  • If an immediate upgrade is not feasible, manually sanitize the domain and path arguments before passing them to hackney_cookie:setcookie/3, ensuring no CRLF or control characters are present.
  • Inspect outgoing HTTP responses for unexpected Set-Cookie headers or abnormal header injection to confirm that no CRLF injection is occurring.

Generated by OpenCVE AI on November 22, 2026 at 23:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-mp55-p8c9-rfw2 Hackney has CRLF / header injection via unvalidated `domain` and `path` options
History
Type Values Removed Values Added
Description Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Response Splitting. The hackney_cookie:setcookie/3 function in src/hackney_cookie.erl validates the Name and Value arguments against CRLF and control characters, but concatenates the domain and path options verbatim into the output iolist with no equivalent check. An attacker who controls either option — for example by supplying a Host header value forwarded as the cookie domain, or a request path forwarded as the cookie path — can inject a literal CRLF sequence and arbitrary additional Set-Cookie headers into the HTTP response. This issue affects hackney: from 0.9.0 before 4.0.1. Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Response Splitting. The hackney_cookie:setcookie/3 function in src/hackney_cookie.erl validates the Name and Value arguments against CRLF and control characters, but concatenates the domain and path options verbatim into the output iolist with no equivalent check. An attacker who controls either option — for example by supplying a Host header value forwarded as the cookie domain, or a request path forwarded as the cookie path — can inject a literal CRLF sequence and arbitrary additional Set-Cookie headers into the HTTP response. This issue affects hackney: from 0.9.0 before 4.0.1.
References
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Response Splitting. The hackney_cookie:setcookie/3 function in src/hackney_cookie.erl validates the Name and Value arguments against CRLF and control characters, but concatenates the domain and path options verbatim into the output iolist with no equivalent check. An attacker who controls either option — for example by supplying a Host header value forwarded as the cookie domain, or a request path forwarded as the cookie path — can inject a literal CRLF sequence and arbitrary additional Set-Cookie headers into the HTTP response. This issue affects hackney: from 0.9.0 before 4.0.1.
Title CRLF injection in cookie domain/path options in hackney
First Time appeared Benoitc
Benoitc hackney
Weaknesses CWE-93
CPEs cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*
Vendors & Products Benoitc
Benoitc hackney
References
Metrics cvssV4_0

{'score': 2.1, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N'}

Weaknesses
  • CWE-93

    Improper Neutralization of CRLF Sequences ('CRLF Injection')

Sources

Status
PUBLISHED
Assigner
EEF
Published
Updated
Nov 20, 2026, 7:59 AM
Reserved
May 18, 2026, 5:28 PM
Status
Modified
Published
May 25, 2026, 3:16 PM
Modified
Nov 20, 2026, 8:18 AM